feat: Emit course completion related events#28415
Conversation
|
Thanks for the pull request, @rehanedly! I've created OSPR-5955 to keep track of it in JIRA, where we prioritize reviews. Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
5834eb2 to
0847ac7
Compare
52cebb6 to
e78de4f
Compare
|
@rehanedly Thank you for your contribution. Please let me know once it is ready for our review. |
ed795e4 to
1392e17
Compare
|
@rehanedly Thank you for letting me know. @nasthagiri Is this still part of the project @ziafazal is working on? Would you expect GTA to review this? |
nasthagiri
left a comment
There was a problem hiding this comment.
Thanks for this PR. It's a fundamental step in providing the needed platform events for emitting xAPI/Caliper completion events.
lms/djangoapps/grades/events.py
Outdated
There was a problem hiding this comment.
[doc request] Can you add documentation (comments or ADR) on the meaning of each of these newly defined events?
There was a problem hiding this comment.
@nasthagiri here is the PR of ADR. https://github.com/edx/edx-platform/pull/28424/files
There was a problem hiding this comment.
Ah. Great. Can you add a link to the ADR from here as context?
There was a problem hiding this comment.
@nasthagiri can you please review this ADR and Approve it https://github.com/edx/edx-platform/pull/28424. Then I will add file link. Currently I can add file link from this PR
lms/djangoapps/grades/events.py
Outdated
There was a problem hiding this comment.
[Seeking info] Why do some events contain the username in addition to the user_id?
There was a problem hiding this comment.
@nasthagiri We need username to get_anonymous_user_id_by_username in event routing backend.
There was a problem hiding this comment.
huh. Interesting. Could we update event-routing-backend to leverage user_id or username, whichever is available?
As decided in OEP-32, The LMS user_id should be used for all internal events. The username is PII and we'd like to limit its usage as much as possible - especially in events and APIs.
lms/djangoapps/grades/events.py
Outdated
There was a problem hiding this comment.
[double checking] Are event_transaction_id and event_transaction_type meaningful in these new events?
There was a problem hiding this comment.
@nasthagiri Added those for consistency with other events of grades. These fields might not be meaning full for xAPI/Caliper but could be meaningful for other backends like logging or segmentation and these fields are present in many of other events emits from edx-platform.
There was a problem hiding this comment.
[doc readability request] This is a critical comment that explains the definition of this signal. Would you rephrase the comment to something like:
This Signal indicates that the user has received a passing grade in the course for the first time. Any subsequent grade changes that may vary the passing/failing status will not re-trigger this event.
There was a problem hiding this comment.
[renaming consideration] Since course "completion" is an emerging term in the platform with different opinions on how to define it, can we have the core Grades layer be more precise on what this event entails? Specifically, what if we rename this event to COURSE_GRADE_PASSED_FIRST_TIME ?
|
Would someone from @edx/masters-devs-gta also want to review this PR? |
|
[Nit] Since |
10a1ae7 to
eb6a7ef
Compare
There was a problem hiding this comment.
[request to follow-through on renaming] Can you follow through on updating the name of the course_completed events elsewhere in this PR?
Essentially, within the core grades layer, let's be precise of what the event actually is. Then, in a higher layer (for now, it could be at the xapi-caliper transformation layer), we can decide that a course_grade_passed_first_time event translates to a course_completion event.
There was a problem hiding this comment.
@nasthagiri I have renamed this event. we will. handle translation in the event routing backend
|
Your PR has finished running tests. There were no failures. |
|
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. |
|
@rehanedly 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Emit following events:1. edx.course.grade.now_passed event from lms/djangoapps/certificates/signals.py on COURSE_GRADE_NOW_PASSED receiver in listen_for_passing_grade function2. edx.course.grade.now_failed event from lms/djangoapps/certificates/signals.py on COURSE_GRADE_NOW_FAILED receiver in _listen_for_failing_grade function3. edx.course.completed event fromedx-platform/lms/djangoapps/grades/models.py on passed_timestamp save in update_or_create function
Please give the pull request a short but descriptive title.
Use conventional commits to separate and summarize commits logically:
https://open-edx-proposals.readthedocs.io/en/latest/oep-0051-bp-conventional-commits.html
Use this template as a guide. Omit sections that don't apply. You may link to information rather than copy it.
More details about the template are at openedx/openedx-proposals#180
(link will be updated when that document merges)
-->
Description
Here is the ADR for this implemetation https://github.com/edx/edx-platform/pull/28424/files
Useful information to include:
"Developer", and "Operator".
changes.
Supporting information
Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for testing this change.
Deadline
"None" if there's no rush, or provide a specific date or event (and reason) if there is one.
Other information
Include anything else that will help reviewers and consumers understand the change.