-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat: Adds a new discussion topic configuration mechanism [BD-38] [TNL-8623] [BB-4968] #29082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adds a new discussion topic configuration mechanism [BD-38] [TNL-8623] [BB-4968] #29082
Conversation
|
Thanks for the pull request, @xitij2000! I've created BLENDED-987 to keep track of it in Jira. More details are on the BD-38 project page. When this pull request is ready, tag your edX technical lead. |
0d0fd11 to
11de315
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's a comment or code commented out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I'm leaving this comment out since we don't have the new discussion provider set up or usable. The idea is to only send this signal if the provider needs it.
In this case I think we can just move this logic to inside the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a course_wide topic is deleted we need to handle moving all content from that topic to the general topic which can't be deleted.
For this we can introduce a new signal: topic_deleted here: https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/django_comment_common/signals.py
The signal handler for this can then execute a query to move over all content.
Note for future: Might be useful to also have events for topic_created and topic_edited though I'm not sure if we should just have this code send signal and move the logic to signal handlers, since it seems inefficient, and I don't have a real use case other than delete yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is meant to be for the new discussions experience. It will share most code with the legacy experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really need a group right now since we don't have different topic ids across cohorts. This makes it easier to merge them since you can just stop filtering for group_id if cohorting is disabled.
However, a future in-context external provider might need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If preferable, we can remove this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The APIs and other mechanism already make sure that changes applied are in sync across the course structure and the models.
6d33b98 to
d6d3dd4
Compare
|
👍
|
3afc4df to
b508fb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be triggered every time? Or should it be triggered only if the course has in-context discussions enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to add that logic to a generic place. So that logic is in the task itself. Additionally, there may be other things that this code can do which apply to providers that don't support in-context discussions as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this external_id used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The external_id is what will store the commentable id that is used by cs_comments_service. In the future, if we are dealing with another provider that supports in-context discussions, this can be used for them as well.
1c1a2e2 to
98b18d6
Compare
|
@xitij2000 Can you please resolve the conflicts on this PR? |
The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course. The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.
98b18d6 to
7d2bab5
Compare
Done. |
|
Your PR has finished running tests. There were no failures. |
|
@xitij2000 Is this ready to be merged? |
Yes. |
|
@xitij2000 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
| 'openedx': { | ||
| 'features': [ | ||
| Features.BASIC_CONFIGURATION.value, | ||
| Features.PRIMARY_DISCUSSION_APP_EXPERIENCE.value, | ||
| Features.QUESTION_DISCUSSION_SUPPORT.value, | ||
| Features.COMMUNITY_TA_SUPPORT.value, | ||
| Features.REPORT_FLAG_CONTENT_TO_MODERATORS.value, | ||
| Features.AUTOMATIC_LEARNER_ENROLLMENT.value, | ||
| Features.ANONYMOUS_POSTING.value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this provider was added? this actually breaks the discussions app on stage/prod.
https://course-authoring.stage.edx.org/course/course-v1:UBCx+Water201x_2+2T2015/pages-and-resources/discussion/settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awaisdar001 I think I mentioned this on one of the calls. It's the provider for the new experience.
I have a PR ready to add support for it in the MFE here: openedx/frontend-app-authoring#217
I think I should have gotten that merged first, or included this change with a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xitij2000 the mentioned PR is not ready yet, can you suggest how we can address this "bad user experience" in the short term? Maybe only revert the provide change in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@awaisdar001 I will make a PR that removes this provider right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @xitij2000
Description
The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course.
The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.
Dependencies
This PR build on a few other PRs:
The relevant commit is currently: 11de31553ca4e0f1dc816ae88235e41160e1d5f3
Supporting information
Testing instructions
Deadline
"None"