Skip to content

Conversation

Akanshu-2u
Copy link
Contributor

@Akanshu-2u Akanshu-2u commented Sep 22, 2025

Description:

This PR approaches the contraction of the FEATURES dict and moving the settings within devstack into top level settings.

Solution:

  • Contracted FEATURES dict within:

    • lms.py
    • cms.py
    • lms.yml

Related PRs

JIRA Ticket:

BOMS-200

@Copilot Copilot AI review requested due to automatic review settings September 22, 2025 12:46
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Refactors configuration by deprecating the centralized FEATURES dict and promoting individual feature flags to top‑level settings across LMS/CMS Python config files and the LMS YAML config. This flattens feature flag definitions and updates in‑file references accordingly.

  • Replace FEATURES[...] assignments with top-level constants in lms.py and cms.py
  • Update conditionals to reference new constants (e.g., enterprise & third-party auth)
  • Remove FEATURES: namespace from lms.yml, flattening former nested keys

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
py_configuration_files/lms.py Converts multiple feature flag assignments from FEATURES dict entries to standalone constants and adjusts conditional checks.
py_configuration_files/cms.py Mirrors refactor for Studio feature flags to standalone constants.
configuration_files/lms.yml Removes FEATURES: mapping key and promotes its child keys to top-level YAML entries.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

########################## Third Party Auth #######################

if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and (
if ENABLE_THIRD_PARTY_AUTH and (
Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

Previously this conditional used FEATURES.get('ENABLE_THIRD_PARTY_AUTH'), which safely returned None/False if the flag was absent; switching to a bare variable introduces a potential NameError if ENABLE_THIRD_PARTY_AUTH is not defined earlier. Define ENABLE_THIRD_PARTY_AUTH above (e.g., ENABLE_THIRD_PARTY_AUTH = False) or guard with globals().get('ENABLE_THIRD_PARTY_AUTH') to preserve prior fallback behavior.

Suggested change
if ENABLE_THIRD_PARTY_AUTH and (
if globals().get('ENABLE_THIRD_PARTY_AUTH') and (

Copilot uses AI. Check for mistakes.

SHOW_FOOTER_LANGUAGE_SELECTOR: false
SHOW_HEADER_LANGUAGE_SELECTOR: false
AUTH_USE_OPENID_PROVIDER: true
AUTOMATIC_AUTH_FOR_TESTING: false
Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

Removing the parent FEATURES: key and promoting these entries to top-level is a breaking shape change for any loader logic expecting a FEATURES mapping. Confirm and update any configuration parsing code (or provide a migration path); if compatibility is required, consider keeping an empty FEATURES node or duplicating keys during a transition period.

Suggested change
AUTOMATIC_AUTH_FOR_TESTING: false
AUTOMATIC_AUTH_FOR_TESTING: false
FEATURES:
CUSTOM_COURSES_EDX: false
ENABLE_BULK_ENROLLMENT_VIEW: false
ENABLE_COMBINED_LOGIN_REGISTRATION: true
ENABLE_CORS_HEADERS: false
ENABLE_COUNTRY_ACCESS: false
ENABLE_CREDIT_API: false
ENABLE_CREDIT_ELIGIBILITY: false
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: false
ENABLE_CSMH_EXTENDED: true
ENABLE_DISCUSSION_HOME_PANEL: true
ENABLE_DISCUSSION_SERVICE: true
ENABLE_EDXNOTES: true
ENABLE_ENROLLMENT_RESET: false
ENABLE_EXPORT_GIT: false

Copilot uses AI. Check for mistakes.

Comment on lines +416 to 417
SHOW_HEADER_LANGUAGE_SELECTOR = True

Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] With the removal of the shared FEATURES container, related feature flags are now standalone constants; consider adding a brief comment block or a consistent prefix (e.g., FEATURE_) to retain logical grouping and make future bulk operations (search, tooling) easier.

Suggested change
SHOW_HEADER_LANGUAGE_SELECTOR = True
# Feature flags (for devstack and development purposes)
FEATURE_SHOW_HEADER_LANGUAGE_SELECTOR = True

Copilot uses AI. Check for mistakes.

Comment on lines +414 to +422
AUTOMATIC_AUTH_FOR_TESTING = True
ENABLE_DISCUSSION_SERVICE = True
SHOW_HEADER_LANGUAGE_SELECTOR = True

# Enable enterprise integration by default.
# See https://github.com/openedx/edx-enterprise/blob/master/docs/development.rst for
# more background on edx-enterprise.
# Toggle this off if you don't want anything to do with enterprise in devstack.
'ENABLE_ENTERPRISE_INTEGRATION': True,
})
# Enable enterprise integration by default.
# See https://github.com/openedx/edx-enterprise/blob/master/docs/development.rst for
# more background on edx-enterprise.
# Toggle this off if you don't want anything to do with enterprise in devstack.
ENABLE_ENTERPRISE_INTEGRATION = True
Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] With the removal of the shared FEATURES container, related feature flags are now standalone constants; consider adding a brief comment block or a consistent prefix (e.g., FEATURE_) to retain logical grouping and make future bulk operations (search, tooling) easier.

Copilot uses AI. Check for mistakes.

@Akanshu-2u Akanshu-2u changed the title refactor: Boms-200 handle features setting dict depr refactor: BOMS-200 contract features dict settings into top level settings Sep 22, 2025
Copy link
Contributor

@chintanjoshi-apphelix-2u chintanjoshi-apphelix-2u left a comment

Choose a reason for hiding this comment

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

Is cms.yml file missed in making the changes are we leaving it out on purpose ?

@Akanshu-2u
Copy link
Contributor Author

Akanshu-2u commented Oct 1, 2025

Is cms.yml file missed in making the changes are we leaving it out on purpose ?

Added cms.yml file, it was missed out. Thank you for the reminder.

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.

2 participants