refactor: migrate COURSEWARE_SEARCH_INCLUSION_DATE off FEATURES-as-dict - #39004
Open
feanil wants to merge 1 commit into
Open
refactor: migrate COURSEWARE_SEARCH_INCLUSION_DATE off FEATURES-as-dict#39004feanil wants to merge 1 commit into
feanil wants to merge 1 commit into
Conversation
This flag is a YYYY-MM-DD cutoff date, not a boolean: courseware search is
exposed for courses whose start date is after it. Its two readers had
conflicting inline defaults, which is why it was deferred:
- LMS `courseware_mfe_search_enabled` view read
`settings.FEATURES.get('COURSEWARE_SEARCH_INCLUSION_DATE')` (default None
→ date-based rollout off; search only where the courseware.mfe_courseware_search
waffle flag enables it).
- The Studio `reindex_course --from_inclusion_date` command read
`settings.FEATURES.get('COURSEWARE_SEARCH_INCLUSION_DATE', '2020-01-01')` and
immediately strptime()s it, so it needs a non-None string floor.
Introduce a single annotated flat setting `COURSEWARE_SEARCH_INCLUSION_DATE = None`
in openedx/envs/common.py (the configured value is genuinely shared by both
processes). The LMS reads it bare; the reindex command keeps its 2020-01-01
floor for the unconfigured case, now via an explicit fallback that also logs a
warning so operators can see the default is being assumed. Documented the
`--from_inclusion_date` behavior in the command help/docstring, and converted
both tests' FEATURES overrides to `@override_settings(...)` (plus a new test for
the warn-and-default path).
No behavior change: LMS absence still disables the date gate; the reindex
command still floors an unset value at 2020-01-01.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
feanil
marked this pull request as ready for review
August 19, 2026 15:18
This was referenced Aug 19, 2026
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.
This gets its on PR because it's a date string (
YYYY-MM-DD), not a boolean, and its two readers had conflicting absence-defaults.What it controls
A cutoff date: courseware search is exposed for courses whose
startdate is after it — the mechanism for rolling search out to newer courses without enabling it for the whole back catalog.courseware_mfe_search_enabled(GET .../courseware-search/enabled/, consumed by the Learning MFE) — readFEATURES.get('COURSEWARE_SEARCH_INCLUSION_DATE'), default None = date-based rollout off (search only where thecourseware.mfe_courseware_searchwaffle flag turns it on). Learner-facing.reindex_course --from_inclusion_date(operator-run) — readFEATURES.get(..., '2020-01-01')andstrptime()s it, so it needs a non-None floor.Approach (chosen after review)
One annotated flat setting
COURSEWARE_SEARCH_INCLUSION_DATE = Noneinopenedx/envs/common.py(the configured value is genuinely shared by both processes). LMS reads it bare; the reindex command keeps its2020-01-01floor for the unconfigured case via an explicit fallback that now also logs a warning so operators see the default is being assumed. Updated the command's--from_inclusion_datehelp text and docstring, and converted both tests' FEATURES overrides to@override_settings(...)(plus a new test for the warn-and-default path).No behavior change: LMS absence still disables the date gate; the reindex command still floors an unset value at 2020-01-01.