refactor!: remove HomePageCourses API v1 [DEPR]#38742
Conversation
|
Thanks for the pull request, @irfanuddinahmad! 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 removes the deprecated v1 “HomePageCourses” endpoint (GET /api/contentstore/v1/home/courses) from the CMS contentstore REST API, along with its serializer and associated v1 tests, aligning the codebase with the v2 endpoint that has superseded it.
Changes:
- Removed
HomePageCoursesViewfrom v1 views and routing (home/courses), so the endpoint is no longer exposed. - Removed
CourseHomeTabSerializer, which was only used by the deleted v1 endpoint. - Deleted the v1 test class dedicated to the removed endpoint and cleaned up now-unused imports.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
cms/djangoapps/contentstore/rest_api/v1/views/tests/test_home.py |
Removes v1 tests and imports that only existed to cover the deleted home/courses endpoint. |
cms/djangoapps/contentstore/rest_api/v1/views/home.py |
Deletes HomePageCoursesView and its related imports. |
cms/djangoapps/contentstore/rest_api/v1/views/__init__.py |
Stops exporting the removed v1 view. |
cms/djangoapps/contentstore/rest_api/v1/urls.py |
Removes the home/courses route and HomePageCoursesView import. |
cms/djangoapps/contentstore/rest_api/v1/serializers/home.py |
Removes CourseHomeTabSerializer since the endpoint is deleted. |
cms/djangoapps/contentstore/rest_api/v1/serializers/__init__.py |
Stops exporting the removed serializer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Removes the HomePageCourses API v1 endpoint (GET /api/contentstore/v1/home/courses) as it has been superseded by v2 since the Sumac release and is no longer used by the Authoring MFE. Removes: - HomePageCoursesView and its URL from contentstore v1 - CourseHomeTabSerializer (only used by the removed view) - All associated tests (HomePageCoursesViewTest) - Unused imports (get_course_context, CourseHomeTabSerializer) Closes: openedx/public-engineering#287 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The v2 test setUp was still calling reverse("cms.djangoapps.contentstore:v1:courses")
but the result was never used. Now that the v1 URL is removed this would raise
NoReverseMatch, so drop the unused line.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fe9a80f to
e702c3a
Compare
Summary
HomePageCoursesAPI v1 endpoint (GET /api/contentstore/v1/home/courses) which has been superseded by v2 since Sumac and is no longer referenced by the Authoring MFECourseHomeTabSerializer(exclusively used by the removed view)HomePageCoursesViewTestand the unused imports it introduced (OrderedDict,datetime,timedelta,pytz,CourseOverviewFactory)get_course_contextimport fromviews/home.pyCloses openedx/public-engineering#287
Test plan
HomePageViewTestandHomePageLibrariesViewTeststill passGET /api/contentstore/v1/home/coursesreturns 404GET /api/contentstore/v1/homeandGET /api/contentstore/v1/home/librariesstill return 200🤖 Generated with Claude Code