FC-73 Add EXTERNAL_GRADER_SCORE_SUBMITTED signal to broadcast scoring events (Feature: Add event emission for external grader scores) #292
Conversation
|
Thanks for the pull request, @leoaulasneo98! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #292 +/- ##
==========================================
+ Coverage 94.79% 95.89% +1.09%
==========================================
Files 18 21 +3
Lines 2423 2828 +405
Branches 99 117 +18
==========================================
+ Hits 2297 2712 +415
+ Misses 115 106 -9
+ Partials 11 10 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e9eb42d to
c2d51fb
Compare
bb76448 to
92126be
Compare
92126be to
9d61a74
Compare
|
If you feel that they're too intertwined to review separately, then I'm okay with it. But I would prefer to review separately. At a glance, their functionality is different enough, and even the smaller one is about a thousand lines of code--which is plenty large enough for a pull request. |
- Add XqueueViewSet with complete xqueue-watcher service compatibility - Implement get_submission service for retrieving pending submissions - Add put_result service with row-level locking (select_for_update(nowait=True)) to prevent race conditions - Ensure concurrent xqueue-watcher instances process each submission exactly once, even under high load - Implement standardized response format for backward compatibility - Add session management and authentication handling for XWatcher clients - Add comprehensive test coverage for core interactions
…nd add timeout mechanism (Get Submission) - Implemented locking to ensure submissions are processed by a single xqueue watcher. - Added timeout mechanism for submissions stuck in 'pulled' state. - Updated tests to cover new error scenarios and timeout handling.
- Renamed variables from 'submission_record' to 'external_grader' throughout the codebase for better consistency with model naming - Added new 'retry' status to integrate with submission processing retry services - Removed unused 'is_processable' method that wasn't providing any value - Enhanced test coverage - Add new status external grader detail migration
709aba0 to
07dc74f
Compare
This commit adds the EXTERNAL_GRADER_SCORE_SUBMITTED event emission to the put_result endpoint in the XQueueViewSet. When a grader submits a result and the score is successfully saved, the system now emits an event with all the necessary information for the LMS to render the graded XBlock. Key changes: - Add queue_key field to ExternalGraderDetail model - Include queue_key in create_external_grader_detail method - Emit EXTERNAL_GRADER_SCORE_SUBMITTED event after successful score update - Implement robust false to propagate error and put submission in pending queue again - Add migration for the new queue_key field - Add openedx-events dependency This enables the event-driven approach for updating XBlocks with scoring data from the edx-submissions service, supporting the gradual migration away from HTTP-based XQueue callbacks.
07dc74f to
4602624
Compare
|
This PR can be closed now as the superseeding PR has been merged with these changes in the repository. |
FC-73 Feature: Add event emission for external grader scores
Description
This PR adds event emission to notify when an external grader submits a score result. When a grader submits a result and the score is successfully saved, the system now emits an event with all necessary information for the LMS to render the graded XBlock.
The implementation leverages the existing external grading workflow in the XQueueViewSet and adds a signaling layer through the EXTERNAL_GRADER_SCORE_SUBMITTED event. This change is essential to enable the gradual migration from HTTP-based callbacks (XQueue) to an event-driven approach.
Key changes:
Supporting information
This PR is part of the migration from the XQueue system to an event-based architecture for external grading. It builds upon changes implemented in previous PRs in the FC-73 project that have already established:
Testing instructions
Deadline
None
Other information
This PR completes the event emission architecture for the external grading workflow. With this implementation, event consumers in the LMS can now react to scores submitted by external graders without relying on HTTP callbacks.
Dependencies
This PR directly depends on previous PRs in the FC-73 series that implemented: