Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add system check to warn of pending devstack settings removal #34795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions lms/envs/docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ LMS Configuration Settings
==========================

The lms.envs module contains project-wide settings, defined in python modules
using the standard `Django Settings`_ mechanism.
using the standard `Django Settings`_ mechanism, plus some Open edX
particularities, which we describe below.

.. _Django Settings: https://docs.djangoproject.com/en/2.2/topics/settings/

Different python modules are used for different setting configuration options.
To prevent duplication of settings, modules import values from other modules,
as shown in the diagram below.

.. image:: images/lms_settings.png
.. _Django Settings: https://docs.djangoproject.com/en/dev/topics/settings/


YAML Configuration Files
Expand Down
Binary file removed lms/envs/docs/images/lms_settings.png
Binary file not shown.
3 changes: 2 additions & 1 deletion openedx/core/djangoapps/util/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ def ready(self):
"""
Registers signal handlers at startup.
"""
import openedx.core.djangoapps.util.signals # lint-amnesty, pylint: disable=unused-import, unused-variable
import openedx.core.djangoapps.util.signals # pylint: disable=unused-import, unused-variable
import openedx.core.djangoapps.util.checks # pylint: disable=unused-import, unused-variable
36 changes: 36 additions & 0 deletions openedx/core/djangoapps/util/checks.py
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 []
Loading