fix: adjust gradebook URL to correct value#38479
fix: adjust gradebook URL to correct value#38479dwong2708 wants to merge 4 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @dwong2708! 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. DetailsWhere 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. |
There was a problem hiding this comment.
Pull request overview
This PR fixes how the Instructor API v2 exposes the writable Gradebook MFE URL for a course, aligning it with the expected WRITABLE_GRADEBOOK_URL format and ensuring SiteConfiguration overrides are respected.
Changes:
- Update
WRITABLE_GRADEBOOK_URLusage to stop appending a hardcoded/gradebook/segment and instead append only/<course_key>. - Retrieve
WRITABLE_GRADEBOOK_URLviaconfiguration_helpers.get_valueto honor site-level overrides. - Adjust devstack default and extend API v2 tests to validate the returned
gradebook_url.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lms/envs/devstack.py |
Updates devstack WRITABLE_GRADEBOOK_URL to include the /gradebook path segment. |
lms/djangoapps/instructor/views/serializers_v2.py |
Fixes Gradebook URL construction and switches to SiteConfiguration-aware lookup. |
lms/djangoapps/instructor/tests/test_api_v2.py |
Adds assertions/decorators to validate gradebook_url in course metadata response. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
68d1441 to
5b0404c
Compare
Description
The
get_gradebook_urlmethod inCourseInformationSerializerV2was building the gradebook URL incorrectly in two ways:It was appending a hardcoded
/gradebook/path segment, but theWRITABLE_GRADEBOOK_URLsetting is already expected to include that path. The correct URL should be{WRITABLE_GRADEBOOK_URL}/{course_key}.It was reading
WRITABLE_GRADEBOOK_URLdirectly fromsettingsinstead of going throughconfiguration_helpers.get_value, which meant site-level configuration overrides were being ignored.Testing instructions
WRITABLE_GRADEBOOK_URLto the full gradebook MFE base URL including the path (e.g.http://localhost:1994/gradebook).CourseMetadataViewAPI endpoint for that course.gradebook_urlin the response ishttp://localhost:1994/gradebook/<course_key>.Deadline
Verawood