Skip to content

feat!: Flip Studio MFE Waffle Flags to be On-By-Default#36495

Merged
kdmccormick merged 2 commits intoopenedx:masterfrom
kdmccormick:kdmccormick/legacy-studio-depr-flip-waffles
Apr 24, 2025
Merged

feat!: Flip Studio MFE Waffle Flags to be On-By-Default#36495
kdmccormick merged 2 commits intoopenedx:masterfrom
kdmccormick:kdmccormick/legacy-studio-depr-flip-waffles

Conversation

@kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Apr 7, 2025

Description

This makes nearly all of Studio React-by-default by replacing
the "opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags.
Here is the mapping:

  • contentstore.new_studio_mfe.use_new_unit_page ->
    !legacy_studio.unit_editor
  • new_core_editors.use_new_problem_editor ->
    !legacy_studio.problem_editor
  • new_core_editors.use_new_text_editor ->
    !legacy_studio.text_editor
  • new_core_editors.use_new_video_editor ->
    !legacy_studio.video_editor
  • new_studio_mfe.use_new_home_page ->
    !legacy_studio.home
  • contentstore.new_studio_mfe.use_new_custom_pages ->
    !legacy_studio.custom_pages
  • contentstore.new_studio_mfe.use_new_schedule_details_page ->
    !legacy_studio.schedule_details
  • contentstore.new_studio_mfe.use_new_advanced_settings_page ->
    !legacy_studio.advanced_settings
  • contentstore.new_studio_mfe.use_new_grading_page ->
    !legacy_studio.grading
  • contentstore.new_studio_mfe.use_new_updates_page ->
    !legacy_studio.updates
  • contentstore.new_studio_mfe.use_new_import_page ->
    !legacy_studio.import
  • contentstore.new_studio_mfe.use_new_export_page ->
    !legacy_studio.export
  • contentstore.new_studio_mfe.use_new_files_uploads_page ->
    !legacy_studio.files_uploads
  • contentstore.new_studio_mfe.use_new_course_outline_page ->
    !legacy_studio.course_outline
  • contentstore.new_studio_mfe.use_new_course_team_page ->
    !legacy_studio.course_team
  • contentstore.new_studio_mfe.use_new_certificates_page ->
    !legacy_studio.certificates
  • contentstore.new_studio_mfe.use_new_textbooks_page ->
    !legacy_studio.textbooks
  • contentstore.new_studio_mfe.use_new_group_configurations_page ->
    !legacy_studio.configurations

Supporting Info

This is part of the plan detailed in: #36275

Merge considerations

I have warned about this in #cc-risky-changes. The waffle flip was extensively communicated using the DEPR process, so there should not be any blocker to merging this.

Test instructions

Other Information

Known issues

  • Even when the legacy experience is enabled, some MFE pages hard-code the MFE URLs, and thus keep you in the MFE when you should be kicked back to legacy. This is an existing issue. I would try to fix this if we had more time.
  • I missed the ENABLE_PAGES_AND_RESOURCES flag on the DEPR waffle because, for historical reasons, it was tucked amongst the discussions toggles rather than the contentstore toggles. So, Studio will still default to the really old Pages page in Teak, unless I can sell BTR on the idea of backporting one more waffle-flip.
  • Some links still send you to the legacy experience before redirecting you back to the MFE. Then end result is fine, but it's a much slower and clunkier experience than it would be if the platform just rendered URLs directly to whichever experience is active. I had hoped to make progress on this for Teak, but ran out of time.
  • Many unit tests will need rework in order to remove the legacy UI without removing a bunch of test coverage. I've tried to add TODO comments to these test modules.

Query count increases

  • cms/djangoapps/contentstore/rest_api/v1/views/tests/test_course_index.py:CourseIndexViewTest.test_number_of_calls_to_db increased from 32 to 33
  • cms/djangoapps/contentstore/views/tests/test_course_index.py:TestCourseOutline.test_number_of_calls_to_db
    increased from 29 to 38 😬

In both cases, the new query(ies) were all:

SELECT "site_configuration_siteconfiguration"."id", "site_configuration_siteconfiguration"."site_id", "site_configuration_siteconfiguration"."enabled", "site_configuration_siteconfiguration"."site_values" FROM "site_configuration_siteconfiguration" WHERE ("site_configuration_siteconfiguration"."enabled" AND "site_configuration_siteconfiguration"."site_values" LIKE '%course\_org\_filter%' ESCAPE '\')

I believe this is all because get_course_authoring_url queries org-level site configuration, and for whatever reason the result isn't cached. Ick.

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from 47ba960 to 7019761 Compare April 7, 2025 20:26
@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch 5 times, most recently from 3da457a to d2e91bd Compare April 11, 2025 15:02
@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from d2e91bd to e07c1a9 Compare April 23, 2025 18:58
@ormsbee
Copy link
Contributor

ormsbee commented Apr 23, 2025

It looks really good. I really like how it demonstrates the value of having independent functions to answer the question of whether something is enabled, allowing us to switch the toggles underneath. I'm not sure if we document that pattern explicitly anywhere.

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from 9c7e299 to f85807b Compare April 24, 2025 02:33
@kdmccormick kdmccormick added the create-sandbox A test sandbox will be created for this PR, using the `open-craft/pr-sandbox-automation` tool label Apr 24, 2025
@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from 7587da1 to 7bf3c0b Compare April 24, 2025 03:48
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from c9e9baf to b30ba54 Compare April 24, 2025 05:22
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch 2 times, most recently from f76a8be to 4bab1d1 Compare April 24, 2025 06:14
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from 4bab1d1 to c9f1a5c Compare April 24, 2025 06:51
@kdmccormick kdmccormick marked this pull request as ready for review April 24, 2025 07:18
@kdmccormick kdmccormick requested a review from ormsbee April 24, 2025 07:18
@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from c9f1a5c to 10447ad Compare April 24, 2025 07:24
kdmccormick added a commit to kdmccormick/edx-platform that referenced this pull request Apr 24, 2025
This makes nearly all of Studio React-by-default by replacing the
"opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags. Here is the
mapping:

* `contentstore.new_studio_mfe.use_new_unit_page` ->
  `!legacy_studio.unit_editor`
* `new_core_editors.use_new_problem_editor` ->
  `!legacy_studio.problem_editor`
* `new_core_editors.use_new_text_editor` ->
  `!legacy_studio.text_editor`
* `new_core_editors.use_new_video_editor` ->
  `!legacy_studio.video_editor`
* `new_studio_mfe.use_new_home_page` ->
  `!legacy_studio.home`
* `contentstore.new_studio_mfe.use_new_custom_pages` ->
  `!legacy_studio.custom_pages`
* `contentstore.new_studio_mfe.use_new_schedule_details_page` ->
  `!legacy_studio.schedule_details`
* `contentstore.new_studio_mfe.use_new_advanced_settings_page` ->
  `!legacy_studio.advanced_settings`
* `contentstore.new_studio_mfe.use_new_grading_page` ->
  `!legacy_studio.grading`
* `contentstore.new_studio_mfe.use_new_updates_page` ->
  `!legacy_studio.updates`
* `contentstore.new_studio_mfe.use_new_import_page` ->
  `!legacy_studio.import`
* `contentstore.new_studio_mfe.use_new_export_page` ->
  `!legacy_studio.export`
* `contentstore.new_studio_mfe.use_new_files_uploads_page` ->
  `!legacy_studio.files_uploads`
* `contentstore.new_studio_mfe.use_new_course_outline_page` ->
  `!legacy_studio.course_outline`
* `contentstore.new_studio_mfe.use_new_course_team_page` ->
  `!legacy_studio.course_team`
* `contentstore.new_studio_mfe.use_new_certificates_page` ->
  `!legacy_studio.certificates`
* `contentstore.new_studio_mfe.use_new_textbooks_page` ->
  `!legacy_studio.textbooks`
* `contentstore.new_studio_mfe.use_new_group_configurations_page` ->
  `!legacy_studio.configurations`

Part of: openedx#36275
@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from 10447ad to c399772 Compare April 24, 2025 07:25
This makes nearly all of Studio React-by-default by replacing the
"opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags. Here is the
mapping:

* `contentstore.new_studio_mfe.use_new_unit_page` ->
  `!legacy_studio.unit_editor`
* `new_core_editors.use_new_problem_editor` ->
  `!legacy_studio.problem_editor`
* `new_core_editors.use_new_text_editor` ->
  `!legacy_studio.text_editor`
* `new_core_editors.use_new_video_editor` ->
  `!legacy_studio.video_editor`
* `new_studio_mfe.use_new_home_page` ->
  `!legacy_studio.home`
* `contentstore.new_studio_mfe.use_new_custom_pages` ->
  `!legacy_studio.custom_pages`
* `contentstore.new_studio_mfe.use_new_schedule_details_page` ->
  `!legacy_studio.schedule_details`
* `contentstore.new_studio_mfe.use_new_advanced_settings_page` ->
  `!legacy_studio.advanced_settings`
* `contentstore.new_studio_mfe.use_new_grading_page` ->
  `!legacy_studio.grading`
* `contentstore.new_studio_mfe.use_new_updates_page` ->
  `!legacy_studio.updates`
* `contentstore.new_studio_mfe.use_new_import_page` ->
  `!legacy_studio.import`
* `contentstore.new_studio_mfe.use_new_export_page` ->
  `!legacy_studio.export`
* `contentstore.new_studio_mfe.use_new_files_uploads_page` ->
  `!legacy_studio.files_uploads`
* `contentstore.new_studio_mfe.use_new_course_outline_page` ->
  `!legacy_studio.course_outline`
* `contentstore.new_studio_mfe.use_new_course_team_page` ->
  `!legacy_studio.course_team`
* `contentstore.new_studio_mfe.use_new_certificates_page` ->
  `!legacy_studio.certificates`
* `contentstore.new_studio_mfe.use_new_textbooks_page` ->
  `!legacy_studio.textbooks`
* `contentstore.new_studio_mfe.use_new_group_configurations_page` ->
  `!legacy_studio.configurations`

Part of: openedx#36275
@kdmccormick kdmccormick force-pushed the kdmccormick/legacy-studio-depr-flip-waffles branch from c399772 to 3c452d0 Compare April 24, 2025 07:25
@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

)
# .. toggle_description: Temporarily fall back to the old proctored exam settings view.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The toggle creation dates are all set to the DEPR acceptance date here instead of when they're actually being created. Is that intentional?

Copy link
Contributor

@ormsbee ormsbee Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nvm, of course it is. Because that's part of the whole six month notice + removal cycle.



def exam_setting_view_enabled():
def exam_setting_view_enabled(course_key):
Copy link
Contributor

@ormsbee ormsbee Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you think about giving course_key a default value of None where you're currently adding a required param, so that we're less likely to break plugins that might have been calling these functions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Odds are small anyhow, but I'm paranoid.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ormsbee I initially agreed, and I was in the process of making that change for this function and for the use_new_$blah_editor functions. But then I realized that this wouldn't really be preserving backwards compatibility--rather, it would be suppressing backwards incompatibility. If a plugin is calling these functions from the context of a course and isn't passing in the course_key, then that is incorrect. It needs to pass in course_key in order to respect WaffleFlagCourseOverride expectations. So, I think I'd rather leave this, and let plugins break if they are reaching into this module.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would still be correct if there weren't course-specific overrides, which is going to be a very common case, since course waffle flags fallback to that behavior if course_key=None. The failure mode would also be, "some users see the wrong thing for a specific course because the plugin doesn't respect course-specific overrides" vs. "all users get a 500 error because the check explodes".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to hold up the PR over it since it's such an edge case, but we should probably message it in the risky-changes slack channel just in case.

@open-craft-grove
Copy link

Sandbox deployment failed 💥
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
📜 Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one question w.r.t adding a default value for checks like exam_setting_view_enabled where it goes from being no-arg to taking an explicit course_key. I'll wait until you're up, since the cut datetime has been pushed to Friday morning EST anyhow.

Otherwise, LGTM.

@kdmccormick kdmccormick requested a review from ormsbee April 24, 2025 15:57
Copy link
Contributor

@ormsbee ormsbee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, with the caveat that I do think it's worth making a few of the feature check calls more backwards compatible with a default course_key of None, even though it won't respect course overrides.

@kdmccormick kdmccormick merged commit 8e9f944 into openedx:master Apr 24, 2025
49 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/legacy-studio-depr-flip-waffles branch April 24, 2025 16:34
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
This makes nearly all of Studio React-by-default by replacing the
"opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags. Here is the
mapping:

* `contentstore.new_studio_mfe.use_new_unit_page` ->
  `!legacy_studio.unit_editor`
* `new_core_editors.use_new_problem_editor` ->
  `!legacy_studio.problem_editor`
* `new_core_editors.use_new_text_editor` ->
  `!legacy_studio.text_editor`
* `new_core_editors.use_new_video_editor` ->
  `!legacy_studio.video_editor`
* `new_studio_mfe.use_new_home_page` ->
  `!legacy_studio.home`
* `contentstore.new_studio_mfe.use_new_custom_pages` ->
  `!legacy_studio.custom_pages`
* `contentstore.new_studio_mfe.use_new_schedule_details_page` ->
  `!legacy_studio.schedule_details`
* `contentstore.new_studio_mfe.use_new_advanced_settings_page` ->
  `!legacy_studio.advanced_settings`
* `contentstore.new_studio_mfe.use_new_grading_page` ->
  `!legacy_studio.grading`
* `contentstore.new_studio_mfe.use_new_updates_page` ->
  `!legacy_studio.updates`
* `contentstore.new_studio_mfe.use_new_import_page` ->
  `!legacy_studio.import`
* `contentstore.new_studio_mfe.use_new_export_page` ->
  `!legacy_studio.export`
* `contentstore.new_studio_mfe.use_new_files_uploads_page` ->
  `!legacy_studio.files_uploads`
* `contentstore.new_studio_mfe.use_new_course_outline_page` ->
  `!legacy_studio.course_outline`
* `contentstore.new_studio_mfe.use_new_course_team_page` ->
  `!legacy_studio.course_team`
* `contentstore.new_studio_mfe.use_new_certificates_page` ->
  `!legacy_studio.certificates`
* `contentstore.new_studio_mfe.use_new_textbooks_page` ->
  `!legacy_studio.textbooks`
* `contentstore.new_studio_mfe.use_new_group_configurations_page` ->
  `!legacy_studio.configurations`

Part of: #36275
marlonkeating pushed a commit that referenced this pull request Jul 15, 2025
This makes nearly all of Studio React-by-default by replacing the
"opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags. Here is the
mapping:

* `contentstore.new_studio_mfe.use_new_unit_page` ->
  `!legacy_studio.unit_editor`
* `new_core_editors.use_new_problem_editor` ->
  `!legacy_studio.problem_editor`
* `new_core_editors.use_new_text_editor` ->
  `!legacy_studio.text_editor`
* `new_core_editors.use_new_video_editor` ->
  `!legacy_studio.video_editor`
* `new_studio_mfe.use_new_home_page` ->
  `!legacy_studio.home`
* `contentstore.new_studio_mfe.use_new_custom_pages` ->
  `!legacy_studio.custom_pages`
* `contentstore.new_studio_mfe.use_new_schedule_details_page` ->
  `!legacy_studio.schedule_details`
* `contentstore.new_studio_mfe.use_new_advanced_settings_page` ->
  `!legacy_studio.advanced_settings`
* `contentstore.new_studio_mfe.use_new_grading_page` ->
  `!legacy_studio.grading`
* `contentstore.new_studio_mfe.use_new_updates_page` ->
  `!legacy_studio.updates`
* `contentstore.new_studio_mfe.use_new_import_page` ->
  `!legacy_studio.import`
* `contentstore.new_studio_mfe.use_new_export_page` ->
  `!legacy_studio.export`
* `contentstore.new_studio_mfe.use_new_files_uploads_page` ->
  `!legacy_studio.files_uploads`
* `contentstore.new_studio_mfe.use_new_course_outline_page` ->
  `!legacy_studio.course_outline`
* `contentstore.new_studio_mfe.use_new_course_team_page` ->
  `!legacy_studio.course_team`
* `contentstore.new_studio_mfe.use_new_certificates_page` ->
  `!legacy_studio.certificates`
* `contentstore.new_studio_mfe.use_new_textbooks_page` ->
  `!legacy_studio.textbooks`
* `contentstore.new_studio_mfe.use_new_group_configurations_page` ->
  `!legacy_studio.configurations`

Part of: #36275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-sandbox A test sandbox will be created for this PR, using the `open-craft/pr-sandbox-automation` tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants