Repository navigation
refactor: read the course optimizer from authoring v1 (FC-0118) - #3367
taimoor-ahmed-1 wants to merge 1 commit into
Conversation
The Course Optimizer page now starts and reads link checks and previous-run link updates through the authoring v1 resources served by openedx/openedx-platform#39304, instead of the four legacy contentstore v0 routes: - POST/GET api/contentstore/v0/link_check{,_status}/{course_id} -> POST/GET api/authoring/v1/courses/{course_key}/link_check/ - POST/GET api/contentstore/v0/rerun_link_update{,_status}/{course_id} -> POST/GET api/authoring/v1/courses/{course_key}/previous_run_link_update/ Both reads send view=full, since the page renders the link check's report and matches each link update's per-link results; the default view carries only the run's state. The API layer maps the link check's status, created_at and output back to linkCheckStatus, linkCheckCreatedAt and linkCheckOutput, and the queued-run answer of a started check to linkCheckStatus, so hooks and components are unchanged. The report's members arrive in snake_case and are camel-cased as before. Starting a run now answers 202, and the link check's fixed error message is not read, as the page derives its failure state from the status. No change is visible to the user.
|
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 #3367 +/- ##
==========================================
+ Coverage 96.36% 96.38% +0.01%
==========================================
Files 1467 1472 +5
Lines 36182 36467 +285
Branches 8692 8814 +122
==========================================
+ Hits 34867 35148 +281
+ Misses 1272 1262 -10
- Partials 43 57 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Part of #3361 (FC-0118 Phase 3, parent openedx/openedx-platform#39349).
Draft until openedx/openedx-platform#39304 merges: it adds the endpoint this PR calls. The old address stays live until it is removed through the DEPR process (openedx/openedx-platform#39128).
Moves the course optimizer's four calls to authoring v1:
POST /api/contentstore/v0/link_check/{course_id}POST /api/authoring/v1/courses/{course_key}/link_check/GET …/v0/link_check_status/{course_id}GET …/v1/courses/{course_key}/link_check/?view=fullPOST …/v0/rerun_link_update/{course_id}POST …/v1/courses/{course_key}/previous_run_link_update/GET …/v0/rerun_link_update_status/{course_id}GET …/v1/courses/{course_key}/previous_run_link_update/?view=fullview=fullbecause the page renders the report and the per-link update results, which the default view leaves out. While a run is in progress,outputis null.status,created_atandoutputare mapped to thelinkCheckStatus,linkCheckCreatedAtandlinkCheckOutputthe hooks use, so the hooks and components are unchanged.User roles impacted: Course Author (Tools → Course Optimizer). No visible change expected.
Supporting information
Testing instructions
npm test -- src/optimizer-pageOther information
Best Practices Checklist
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use. (None added.)../in import paths. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'