Skip to content

fix: course optimizer block links#2946

Open
asajjad2 wants to merge 3 commits intoopenedx:masterfrom
mitodl:areeb/course-optimizer-url
Open

fix: course optimizer block links#2946
asajjad2 wants to merge 3 commits intoopenedx:masterfrom
mitodl:areeb/course-optimizer-url

Conversation

@asajjad2
Copy link
Contributor

@asajjad2 asajjad2 commented Mar 16, 2026

What are the relevant tickets?

#10130

Description

The “Go to block” links in the scan results were built from backend URLs that assume the legacy /editor/html/{blockId} pattern, which works on edX but fails on MITx Online where authoring uses /authoring/course/{courseId}/container/{verticalId}#{blockId}. To make links reliable across deployments, the frontend now derives block URLs itself via buildBlockContainerUrl(courseId, unitId, blockId) using the container route and PUBLIC_PATH, and ScanResults passes courseId through to BrokenLinkTable so all broken/locked/manual and previous-run links open the correct unit/block.

Testing Steps

  1. Start Studio + LMS and the authoring MFE.
  2. Log into Studio and open a course’s Course Optimizer page (e.g. .../authoring/course//optimizer).

Run a scan and verify links

  1. Click Scan course and wait for results to appear.
  2. In the Broken links section, click the “Go to block” link for a broken/locked/manual link.
  3. Confirm the browser navigates to a URL of the form /authoring/course//container/# and opens the correct unit with the expected component selected.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Mar 16, 2026
@openedx-webhooks
Copy link

openedx-webhooks commented Mar 16, 2026

Thanks for the pull request, @asajjad2!

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.

Details
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
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.51%. Comparing base (df79861) to head (0522e03).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/optimizer-page/utils.ts 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2946      +/-   ##
==========================================
- Coverage   95.51%   95.51%   -0.01%     
==========================================
  Files        1329     1329              
  Lines       30557    30577      +20     
  Branches     6713     6720       +7     
==========================================
+ Hits        29186    29205      +19     
- Misses       1315     1316       +1     
  Partials       56       56              

☔ View full report in Codecov by Sentry.
📢 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.

@asajjad2 asajjad2 marked this pull request as ready for review March 16, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants