Skip to content

refactor: migrate Studio Home courses caller to standardized v4 API (FC-0118)#3139

Draft
taimoor-ahmed-1 wants to merge 1 commit into
openedx:masterfrom
taimoor-ahmed-1:taimoor-ahmed/migrate-home-courses-v4
Draft

refactor: migrate Studio Home courses caller to standardized v4 API (FC-0118)#3139
taimoor-ahmed-1 wants to merge 1 commit into
openedx:masterfrom
taimoor-ahmed-1:taimoor-ahmed/migrate-home-courses-v4

Conversation

@taimoor-ahmed-1

Copy link
Copy Markdown

⛔ Draft — blocked by #2540 (do not merge yet)

This PR is intentionally opened as a draft. It is item #3 of the FC-0118
Studio-API caller migration tracked in #3127,
and it is on hold pending #2540 (the "Studio Home" Redux → React Query +
Context refactor). #2540 intends to break the kitchen-sink Studio Home state
(course list, library list, permissions, feature flags, branding) into smaller,
purpose-specific queries; versioning the courses endpoint as-is would entrench a
payload shape we plan to remove. Do not merge until #2540's direction is settled.

Merge order / dependencies

Description

Migrates the Studio Home course list caller from the deprecated v2 endpoint
to the standardized v4 endpoint (FC-0118, ADR 0028/0037):

  • getStudioHomeCoursesV2 now targets GET /api/contentstore/v4/home/courses/
    instead of …/v2/home/courses. The v4 HomeCoursesViewSet is served by a DRF
    DefaultRouter, so the URL now carries the required trailing slash.
  • The deprecated non-paginated v1 home/courses fallback
    (getStudioHomeCourses) had no remaining callers and is removed.
    Pagination, filtering, and ordering are handled natively by v4.

The default (full) response shape is unchanged between v2 and v4 (ADR 0036
?view= presets are opt-in and default to the full payload), so this is a
behaviour-preserving swap for the paginated caller.

Supporting information

Testing instructions

  1. npm ci
  2. npx jest src/studio-home
  3. Manual: open Studio Home, confirm the course list loads, paginates, filters,
    and orders correctly, and that the network tab shows requests to
    /api/contentstore/v4/home/courses/.

Other information

  • Files changed:
    • src/studio-home/data/api.ts — v4 URL + trailing slash; drop v1 fallback.
    • src/studio-home/data/api.test.js — drop the v1-fallback test; bump the
      caller test to v4.
    • src/studio-home/data/thunks.test.js — bump the courses mock regex to v4.
    • src/studio-home/tabs-section/TabsSection.test.tsx — bump the courses mock URL to v4.
  • All 112 src/studio-home tests pass; dprint check is clean.

…FC-0118)

FC-0118 (ADR 0028/0037): point the Studio Home course list at the new
standardized `/api/contentstore/v4/home/courses/` endpoint instead of v2.
The v4 `HomeCoursesViewSet` is served by a DRF DefaultRouter, so the URL now
carries the required trailing slash. The default (full) payload shape is
unchanged, so this is a behaviour-preserving swap for the paginated caller.

The deprecated non-paginated v1 `home/courses` fallback (`getStudioHomeCourses`)
had no remaining callers and is removed; pagination, filtering, and ordering
are handled natively by v4.

Test mocks updated to expect the v4 URL.

Refs openedx#3127

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 16, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @taimoor-ahmed-1!

This repository is currently maintained by @bradenmacdonald.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

Your 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.77%. Comparing base (c1da7f4) to head (22ad64f).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3139      +/-   ##
==========================================
+ Coverage   95.76%   95.77%   +0.01%     
==========================================
  Files        1396     1396              
  Lines       33308    33396      +88     
  Branches     7820     7603     -217     
==========================================
+ Hits        31897    31985      +88     
- Misses       1352     1367      +15     
+ Partials       59       44      -15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Jul 20, 2026
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author

Development

Successfully merging this pull request may close these issues.

3 participants