Skip to content

Remove Legacy Studio UI Waffle Flags and course_waffle_flags API endpoint #38657

@farhan

Description

@farhan

Summary

With the React-based Studio MFE (frontend-app-authoring) now fully handling all Studio pages, the LEGACY_STUDIO_* waffle flags and the API endpoint that served them can be removed from openedx-platform.

Parent epic: (link TBD — openedx/public-engineering)
Frontend sub-task: openedx/frontend-app-authoring#3063

Background

The GET /api/contentstore/v1/course_waffle_flags endpoint was added so the MFE could fetch server-side waffle flag state and conditionally route users to either the new React pages or the legacy Django-rendered Studio pages. That conditional routing is being removed on the frontend side; once shipped, this endpoint will receive zero traffic.

Implementation Details

1. Remove the API endpoint

File: cms/djangoapps/contentstore/rest_api/v1/urls.py

  • Remove the URL pattern for course_waffle_flags

File: cms/djangoapps/contentstore/rest_api/v1/views/course_waffle_flags.py (or equivalent)

  • Delete the view class/function

File: cms/djangoapps/contentstore/rest_api/v1/serializers/ (if applicable)

  • Delete the CourseWaffleFlagsSerializer or equivalent

2. Remove waffle flag definitions

File: cms/djangoapps/contentstore/toggles.py

  • Delete LEGACY_STUDIO_* flag constants (e.g., LEGACY_STUDIO_UNIT_PAGE, LEGACY_STUDIO_COURSE_OUTLINE_PAGE, etc.)
  • Delete helper functions: use_new_unit_page(), use_new_course_outline_page(), use_new_home_page(), use_new_updates_page(), use_new_files_uploads_page(), use_new_video_uploads_page(), use_new_certificates_page(), use_new_textbooks_page(), use_new_custom_pages(), use_new_import_page(), use_new_export_page(), use_new_pdf_editor()

3. Clean up callers

Search for all call sites of the removed helper functions and remove them:

  • cms/djangoapps/contentstore/utils.py — likely has URL-generation helpers conditioned on these flags
  • cms/djangoapps/contentstore/views/component.py — may gate redirect logic on use_new_unit_page()
  • Any remaining Django views that conditionally render legacy templates vs. redirect to MFE

4. Update tests

  • Delete tests that specifically exercise the legacy routing paths (they test dead code)
  • Remove override_waffle_flag / @override_waffle_switch decorators that set these flags in test setup
  • Update API tests to expect 404 on the removed endpoint

5. OEP-0058 / Toggles annotation cleanup

If any of these flags are listed in cms/djangoapps/contentstore/toggles.rst or annotated via code_owner / toggle_name, remove those entries.

Flags Being Removed

Python helper Waffle flag name
use_new_home_page() contentstore.new_studio_mfe.use_new_home_page
use_new_course_outline_page() contentstore.new_studio_mfe.use_new_course_outline_page
use_new_unit_page() contentstore.new_studio_mfe.use_new_unit_page
use_new_updates_page() contentstore.new_studio_mfe.use_new_updates_page
use_new_files_uploads_page() contentstore.new_studio_mfe.use_new_files_uploads_page
use_new_video_uploads_page() contentstore.new_studio_mfe.use_new_video_uploads_page
use_new_certificates_page() contentstore.new_studio_mfe.use_new_certificates_page
use_new_textbooks_page() contentstore.new_studio_mfe.use_new_textbooks_page
use_new_custom_pages() contentstore.new_studio_mfe.use_new_custom_pages
use_new_import_page() contentstore.new_studio_mfe.use_new_import_page
use_new_export_page() contentstore.new_studio_mfe.use_new_export_page
use_new_pdf_editor() contentstore.new_studio_mfe.use_new_pdf_editor

Acceptance Criteria

  • GET /api/contentstore/v1/course_waffle_flags returns 404
  • All LEGACY_STUDIO_* toggle constants are removed from toggles.py
  • All helper functions (use_new_unit_page(), etc.) are deleted with no remaining callers
  • All Studio pages continue to redirect to the MFE correctly (no legacy Django template fallback)
  • CMS test suite passes with no flag-override test scaffolding for these flags

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions