refactor: migrate course_details + grading callers to standardized v3 APIs (FC-0118)#3136
Conversation
FC-0118 (ADR 0037): point the Studio course-details reads/writes at the
new standardized `/api/contentstore/v3/course_details/{course_id}/`
endpoint instead of v1. The v3 ViewSet supports the same GET (retrieve)
and PUT (update) verbs the frontend uses and returns the same
`CourseDetailsSerializer` shape, so this is a behaviour-preserving swap.
The trailing slash is required because v3 is served by a DRF
DefaultRouter (the v1 APIView had no trailing slash); omitting it would
break the PUT via a 301 redirect that drops the request body.
Both call sites are updated so all course_details reads land on v3:
- src/schedule-and-details/data/api.ts (getCourseDetails + updateCourseDetails)
- src/course-outline/data/api.ts (getCourseDetails, duplicate of the above)
Refs openedx#3127
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
FC-0118 (ADR 0031/0037): move the grading-settings write from the legacy
`POST /api/contentstore/v1/course_grading/{course_id}` to the standardized
`PATCH /api/contentstore/v3/authoring_grading/{course_id}/` ViewSet, which
collapses the old GET+POST pair into a single partial_update. The v3 PATCH
returns the same `CourseGradingModelSerializer` payload the v1 POST did, so
the response handling is unchanged.
The read (`getGradingSettings`) intentionally stays on v1: the v3
`authoring_grading` ViewSet only exposes the write (partial_update) and has
no GET, so settings are still fetched from v1 until a v3 read is added.
The trailing slash is required by the DRF DefaultRouter that serves the v3
ViewSet. Test mocks updated to expect PATCH against the v3 URL.
Refs openedx#3127
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thanks for the pull request, @taimoor-ahmed-1! 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 #3136 +/- ##
========================================
Coverage 95.76% 95.76%
========================================
Files 1396 1396
Lines 33308 33312 +4
Branches 7820 7566 -254
========================================
+ Hits 31897 31901 +4
- Misses 1352 1367 +15
+ Partials 59 44 -15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Part of the FC-0118 downstream migration tracked in #3127. Points two of the
Ready Studio API callers at their standardized v3 endpoints. Pure
URL/verb version bumps — no UI or behaviour change for Course Authors.
Commits (one per API, so each can be reviewed / rolled back independently):
course_details→ v3 —getCourseDetails(GET) andupdateCourseDetails(PUT) now target
/api/contentstore/v3/course_details/{course_id}/. The v3ViewSet supports the same GET+PUT and returns the same
CourseDetailsSerializershape. Both call sites are migrated (
schedule-and-detailsand the duplicatein
course-outline) so all course-details reads land on v3.course_gradingwrite → v3authoring_grading— the save(
sendGradingSettings) moves fromPOST v1/course_gradingtoPATCH v3/authoring_grading/{course_id}/, which collapses the old GET+POSTpair into a single
partial_update. Same serializer payload is returned.The trailing slash on both v3 URLs is required — v3 is served by a DRF
DefaultRouter(the v1 APIViews had none). Omitting it would 301-redirect anddrop the request body on PUT/PATCH.
User roles impacted: Course Author (Studio Schedule & Details, Grading
Settings pages). No visible change expected.
Supporting information
openedx/edx-platform, branchfeat/axim-api_improvements):Course Details v3 (#38708), Author Grading v3 (#38726), ADR 0031 (merge
endpoints), ADR 0037 (versioning).
per-call-site verb changes, not a URL swap), the ADR 0029 error-handling
wrapper (own PR), and Course Home [BD-03] [BB-2542] ]Add discussions configuration UI wireframe in MFE #2 / Home Courses adds transifex config and test string #3 (on hold pending Switch from Redux to React Query + Context #2540).
Testing instructions
loads and saving changes persists (network calls hit
.../v3/course_details/<id>/)..../v1/course_grading/<id>) and that saving persists (PATCH.../v3/authoring_grading/<id>/).npm test— updated suites:ScheduleAndDetails.test.tsx(13 passing),GradingSettings.test.jsx(12 passing),course-outlinespot-check green.Other information
edx-platform(feat/axim-api_improvements).The old versions remain live, so this is safe to merge once v3 is deployed.
Best Practices Checklist
propTypes/defaultPropsin new/modified codeinitializeMocksfromsrc/testUtilsapiHooks)description— N/A (no new messages)../added to import paths