refactor: migrate 10 more flags off FEATURES-as-dict (batch 10)#38909
Open
feanil wants to merge 10 commits into
Open
refactor: migrate 10 more flags off FEATURES-as-dict (batch 10)#38909feanil wants to merge 10 commits into
feanil wants to merge 10 commits into
Conversation
The URL was only read via settings.FEATURES.get with an inline False default and was never defined in a common envs file (only in cms/envs/devstack.py). Add an annotated flat setting to cms/envs/common.py, defaulting to None (the idiomatic 'no URL' value, consistent with the sibling keys in the course settings context) and matching the prior falsy default, then read it directly at the CMS-only caller.
…as-dict The setting is only defined in cms/envs/common.py but the reader lives in shared xmodule code reachable from LMS, so use getattr(settings, ..., True) (matching the prior inline default) rather than a bare settings lookup that would AttributeError under LMS.
Already a flat setting in lms/envs/common.py (5000); just switch the lingering FEATURES.get reader and its test override to the flat setting.
Setting is LMS-only (lms/envs/common.py) but the reader is in shared common/djangoapps/course_modes/urls.py, so use getattr with the prior False default. The test's setUp-level patch.dict becomes a class-level @override_settings (trap: override_settings on setUp conflicts with CacheIsolationMixin, and the class needs the flag set during URL reset).
The tpa_hint was only read via settings.FEATURES.get with an inline '' default and was never defined in a common envs file. Add an annotated flat setting (default '') to openedx/envs/common.py so the shared reader in common/djangoapps/student/helpers.py can read it directly from both LMS and CMS, and convert the test overrides.
feanil
force-pushed
the
feanil/features-dict-batch-10
branch
from
July 20, 2026 15:23
385870f to
4b16493
Compare
feanil
marked this pull request as ready for review
July 20, 2026 15:42
feanil
requested review from
a team,
farhan,
irtazaakram and
salman2013
as code owners
July 20, 2026 15:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates 10 more feature flags off
settings.FEATURES['X']dict-style access onto flat settings (settings.X) with@override_settings(X=Y)in tests. Follows the pattern established in #38772.Each commit migrates a single flag:
Notes on a few flags:
FRONTEND_APP_PUBLISHER_URLandTHIRD_PARTY_AUTH_HINThad no flat definition in anyenvs/common.py, so those commits add an annotated definition (matching the prior inline default) before switching the readers.IN_CONTEXT_DISCUSSION_ENABLED_DEFAULTandMODE_CREATION_FOR_TESTINGare only defined in one process's settings but are read from shared code, so those readers usegetattr(settings, 'X', default).