-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add system check to warn of pending devstack settings removal
Note: I had originally implemented this as a `warnings.warn()` call directly in lms/envs/devstack.py and cms/envs/devstack.py, but for whatever reason, those warnings were getting swallowed. System checks display more prominently, anyway. Part of: openedx/public-engineering#247
- Loading branch information
1 parent
72a15e3
commit 7d7a18d
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Miscellaneous system checks | ||
""" | ||
from django.conf import settings | ||
from django.core import checks | ||
|
||
|
||
_DEVSTACK_SETTINGS_MODULES = [ | ||
"lms.envs.devstack", | ||
"lms.envs.devstack_docker", | ||
"lms.envs.devstack_optimized", | ||
"lms.envs.devstack_with_worker", | ||
"cms.envs.devstack", | ||
"cms.envs.devstack_docker", | ||
"cms.envs.devstack_optimized", | ||
"cms.envs.devstack_with_worker", | ||
] | ||
|
||
|
||
@checks.register(checks.Tags.compatibility) | ||
def warn_if_devstack_settings(**kwargs): | ||
""" | ||
Raises a warning if we're using any Devstack settings file. | ||
""" | ||
if settings.SETTINGS_MODULE in _DEVSTACK_SETTINGS_MODULES: | ||
return [ | ||
checks.Warning( | ||
"Open edX Devstack is deprecated, so the Django settings module you are using " | ||
f"({settings.SETTINGS_MODULE}) will be removed from openedx/edx-platform by October 2024. " | ||
"Please either migrate off of Devstack, or modify your Devstack fork to work with an externally-" | ||
"managed Django settings file. " | ||
"For details and discussion, see: https://github.com/openedx/public-engineering/issues/247.", | ||
id="openedx.core.djangoapps.util.W247", | ||
), | ||
] | ||
return [] |