refactor: migrate ENABLE_CSMH_EXTENDED off FEATURES-as-dict in the CSM bigint migration - #39006
Merged
Merged
Conversation
feanil
force-pushed
the
feanil/features-dict-csmh-extended-migration
branch
2 times, most recently
from
August 19, 2026 15:50
9503f3d to
d3c6d0c
Compare
…M bigint migration ENABLE_CSMH_EXTENDED is a flat setting (openedx/envs/common.py, default True); its app readers (courseware/models.py) and tests already use settings.ENABLE_CSMH_EXTENDED. The 2019 0011_csm_id_bigint data migration still read settings.FEATURES["ENABLE_CSMH_EXTENDED"] in two places: - the Migration class body, evaluated at import time (on every migrate / makemigrations / test-DB build), gating an extra dependency; and - database_forwards(), gating the studentmodulehistoryextended ALTER TABLE. Switch both to bare settings.ENABLE_CSMH_EXTENDED, matching models.py. Behavior is identical, and reading the flat setting keeps the migration working for the deployments that still apply it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feanil
force-pushed
the
feanil/features-dict-csmh-extended-migration
branch
from
August 19, 2026 15:52
d3c6d0c to
8d76a1c
Compare
feanil
marked this pull request as ready for review
August 19, 2026 15:54
feanil
enabled auto-merge (rebase)
August 19, 2026 15:55
kdmccormick
approved these changes
Aug 19, 2026
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.
ENABLE_CSMH_EXTENDEDis a flat setting (openedx/envs/common.py, defaultTrue); its app readers (courseware/models.py) and tests already usesettings.ENABLE_CSMH_EXTENDED. The 20190011_csm_id_bigintdata migration still readsettings.FEATURES["ENABLE_CSMH_EXTENDED"]in two places:Migrationclass body, evaluated at import time (on everymigrate/makemigrations/ test-DB build), gating an extra dependency; anddatabase_forwards(), gating thestudentmodulehistoryextendedALTER TABLE.Switch both to bare
settings.ENABLE_CSMH_EXTENDED, matchingmodels.py. Behavior is identical, and reading the flat setting keeps the migration working for the deployments that still apply it.Verified the migration module imports cleanly under LMS settings (the import-time dependency list resolves correctly) and the
coursewarehistoryextendedtests pass. (The pre-existing unusedmodelsimport is left as-is; migrations are excluded from ruff.)