feat: migrates Course Optimizer from Redux to React Query. - #3204
feat: migrates Course Optimizer from Redux to React Query.#3204navinkarkera wants to merge 5 commits into
Conversation
|
Thanks for the pull request, @navinkarkera! 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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3204 +/- ##
==========================================
+ Coverage 95.93% 96.04% +0.10%
==========================================
Files 1397 1395 -2
Lines 33622 33581 -41
Branches 7700 7988 +288
==========================================
- Hits 32256 32253 -3
+ Misses 1323 1287 -36
+ Partials 43 41 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I'm not super familiar with the course optimizer code. When this is ready, could you please check the PRs or git blame to see if one of the main authors may want to review it? If they decline and/or in any case, me or Chris can give the necessary ✅ though. |
8c10778 to
2f5c30e
Compare
Replace the optimizer page's Redux state (slice, thunks, selectors) with React Query hooks for all data fetching, polling, and mutation state. Migrate the page and ScanResults components to the new hooks, convert the optimizer test suite to TypeScript, handle stale-operation detection in the hooks layer, and remove the Redux wiring.
After starting a rerun update, poll until the status endpoint reflects the new operation before accepting a terminal result. The backend commits the new operation's status before the POST response returns, so with no cached previous status an immediately terminal response is accepted; a terminal response equal to the cached previous one is rejected until a new status is observed.
2b473b8 to
dc573ba
Compare
|
@dcoa @jesperhodge @Faraz32123 Can you please review this PR? I am tagging you based of the commit history of the files in the PR, let me know if don't have time or cannot review it for some reason. |
Description
This removes the old Redux slice, selectors, and thunks. It also improves scan status polling and stale-result handling.
This affects Course Authors and Instructors who can edit course content. There is no intended UI change.
Supporting information
Testing instructions
Setup: two runs of the same course
course-v1:Org+CS100+T1(the old run). Add a few units with pages so there are real internal destinations (outline page, a section page, the course page itself).course-v1:Org+CS100+T2. Open the new run once so its pages render.https://example.com/this-page-does-not-exist-12345) in an HTML component, to cover the broken-links path.Exercise Course Optimizer in the new run
/optimizerto the outline URL). Confirm the tool loads with no prior scan data.course-v1:Org+CS100+T2.Expected overall
Best Practices Checklist
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx.../in import paths.