Skip to content

feat: remove legacy feature waffle flags - #3346

Draft
farhan wants to merge 5 commits into
openedx:masterfrom
farhan:farhan/remove-enable-course-optimizer-flag
Draft

farhan wants to merge 5 commits into
openedx:masterfrom
farhan:farhan/remove-enable-course-optimizer-flag

Conversation

@farhan

@farhan farhan commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Removes 3 feature waffle flags from this MFE, one commit per flag, so their features are always on. Product agreed to keep these features and drop their rollout flags (decision). useVideoGalleryFlow is kept on purpose.

# Flag removed What changes for course authors Commit
1 enableCourseOptimizer
contentstore.enable_course_optimizer
Tools → Course Optimizer shows for anyone who can edit course content c041d8c
2 enableCourseOptimizerCheckPrevRunLinks
contentstore.enable_course_optimizer_check_prev_run_links
Optimizer results always include Links to previous course run (the rerun status request only runs when the scan found previous-run links) 4677fc7, c0246b4
3 useReactMarkdownEditor
contentstore.use_react_markdown_editor
The problem editor offers Switch to markdown editor whenever the problem has markdown 71c33b5

Each row shows the frontend name, with the edx-platform flag name below it.

Operator: the MFE no longer reads these 3 flags. A follow-up edx-platform PR will remove the flags and their course_waffle_flags API fields.

Out of scope: studio.custom_relative_dates (isCustomRelativeDatesActive) is handled separately. It changes learner due dates in the LMS, so it's in #3349, which depends on openedx/openedx-platform#39354.

Supporting information

Testing instructions

Make sure all 3 flags above are off or don't exist in Django admin, then:

  1. Optimizer: open a course and click Tools. Course Optimizer should be listed. As a user without edit permission, it should not be listed.
  2. Previous-run links: in a course rerun, run an Optimizer scan. Links to previous course run should list links to the original run, and Update all should work. A course with no such links should show "No results found".
  3. Markdown editor: edit a problem that has markdown. In Settings, Switch to markdown editor should show.

Other information

  • Before this change, the frontend default for useReactMarkdownEditor was true. Only sites that explicitly turned it off will see a change.

🤖 Generated with Claude Code

Product decided to keep the Course Optimizer as an additive feature
and drop its rollout flag. The Tools menu now shows the Optimizer
link to anyone who can edit course content.

Part of openedx#3090.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
farhan and others added 2 commits November 5, 2026 17:13
Product decided to keep the previous-run links check in the Course
Optimizer and drop its rollout flag. The "Links to previous course
run" section and its rerun status query are now always enabled.

Part of openedx#3090.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The markdown problem editor has been on by default for a long time,
so product agreed to drop its rollout flag. The "Switch to markdown
editor" option is now always offered when the problem has markdown.

Part of openedx#3090.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@farhan farhan changed the title feat: remove enableCourseOptimizer flag, always enable optimizer feat: remove legacy feature waffle flags Nov 5, 2026
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.29%. Comparing base (e37528e) to head (bdce0bf).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3346      +/-   ##
==========================================
- Coverage   96.30%   96.29%   -0.01%     
==========================================
  Files        1450     1450              
  Lines       35523    35511      -12     
  Branches     8205     8198       -7     
==========================================
- Hits        34209    34196      -13     
- Misses       1272     1273       +1     
  Partials       42       42              

☔ 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.

@farhan
farhan force-pushed the farhan/remove-enable-course-optimizer-flag branch from 781734b to 0e70f05 Compare November 6, 2026 05:24
@farhan

farhan commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Known issues found in review (resolved)

Reproduced locally (Tutor dev, demo course) with the backend flags still off (the default). Both issues were introduced by this PR; neither happens on master (checked at f2597ab).

1. ✅ Fixed in c0246b4 — Optimizer shows "Some links couldn't be updated." on every results page

Optimizer scan results showing the 'Some links couldn't be updated.' alert
  • This PR stops gating the rerun status query, so ScanResults always calls GET /api/contentstore/v0/rerun_link_update_status/{courseId}.
  • edx-platform still returns 400 while contentstore.enable_course_optimizer_check_prev_run_links is off (course_optimizer.py#L304, #L429).
  • src/optimizer-page/scan-results/ScanResults.tsx (L111-116) turns that error into the alert.
  • Fix (c0246b4): the status query now only runs when the scan returned previous-run links (hasPreviousRunLinksInSections), with regression tests. Verified locally: no request, no alert.

2. ↪️ Moved out of this PR — Outline shows "Custom due date: N weeks from enrollment" that learners don't get

Course outline showing 'Custom due date: 2 weeks from enrollment'
  • The PR made GradingTypeAndDueDate.jsx show relative weeks without checking studio.custom_relative_dates.
  • The LMS still ignores relative_weeks_due while that flag is off (course_date_signals/handlers.py#L145).
  • Resolution: the studio.custom_relative_dates change was removed from this PR. It will come in a separate frontend PR that depends on the edx-platform PR making the LMS always apply relative weeks, so this mismatch can't happen.

Without the flag, the Optimizer always requested the rerun link update
status. edx-platform still rejects that request with 400 while
enable_course_optimizer_check_prev_run_links is off, which showed a
"Some links couldn't be updated." alert on every results page. The
status is only needed for previous-run links, and the scan only finds
them when the backend check is on, so gate the query on them.

Part of openedx#3090.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@farhan

farhan commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Feature screenshots (tested locally)

Tested on Tutor dev with this PR's branch (c0246b4) and openedx-platform master, using a rerun of the demo course. The 3 flags were off: contentstore.enable_course_optimizer and contentstore.enable_course_optimizer_check_prev_run_links don't exist, and contentstore.use_react_markdown_editor was set to off.

1. Course Optimizer shows in the Tools menu (enableCourseOptimizer removed)

optimizer-tools-menu

2. Optimizer results include "Links to previous course run" (enableCourseOptimizerCheckPrevRunLinks removed)

optimizer-previous-run-links
  • The section lists the rerun's links to the original run, and Update all updated both.
  • On openedx-platform master, the scan itself still only detects these links when the backend flag is on (tasks.py#L1032). For this screenshot it was turned on for the test course only, to match the behavior after the backend flag removal.

3. Problem editor offers "Switch to markdown editor" (useReactMarkdownEditor removed)

switch-to-markdown-editor

After switching, the problem opens in the markdown editor:

markdown-editor

With the useReactMarkdownEditor flag removed, the problem having
markdown is the only thing that controls the "Switch to markdown
editor" button, so guard that case directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@farhan

farhan commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Manual testing

Tested on a local tutor dev (openedx-platform master), with the MFE running this branch at bdce0bf1.

Setup

  • Turned on contentstore.enable_course_optimizer_check_prev_run_links in the backend. The backend still uses it to detect previous-run links until the edx-platform follow-up removes it.
  • contentstore.enable_course_optimizer doesn't exist in the database.
  • In the rerun course-v1:OpenedX+DemoX+FlagTest2026 (a rerun of the Demo Course), added an HTML component with 2 links to the original run (/courses/course-v1:OpenedX+DemoX+DemoCourse/...).
# Steps Result
1 Rerun → Tools. Course Optimizer is listed. ✅
2 Rerun → Course Optimizer → Scan course. Links to previous course run lists the 2 links, and rerun_link_update_status returns 200. ✅
3 Click Update on one link. It now points to FlagTest2026 and shows "Updated". ✅
4 Click Update all. The other link is updated too (checked in the backend). ✅
5 Scan the Demo Course (not a rerun). Links to previous course run shows "No results found", and no rerun_link_update_status request is sent. ✅
6 Unit → Add component → Problem → Single select → Show advanced settings. Switch to markdown editor shows, and switching opens the markdown editor with the template. ✅
7 From the markdown editor, Switch to advanced editor. The OLX editor opens. ✅
8 Save the problem from the advanced editor (no markdown), reopen it → Show advanced settings. Only Switch to advanced editor shows. ✅
9 Content library → Add component → Problem → Single select → Show advanced settings. Switch to markdown editor shows. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant