Skip to content

feat: dump_settings management command - #36162

Merged
kdmccormick merged 1 commit into
openedx:masterfrom
kdmccormick:kdmccormick/dump-settings
Jan 27, 2025
Merged

feat: dump_settings management command#36162
kdmccormick merged 1 commit into
openedx:masterfrom
kdmccormick:kdmccormick/dump-settings

Conversation

@kdmccormick

@kdmccormick kdmccormick commented Jan 23, 2025

Copy link
Copy Markdown
Member

Description

This command dumps the current Django settings to JSON for
debugging/diagnostics. The output of this command is for humans... it
is NOT suitable for consumption by production systems.

In particular, we are introducing this command as part of a series of
refactorings to the Django settings files lms/envs/* and cms/envs/*.
We want to ensure that these refactorings do not introduce any
unexpected breaking changes, so the dump_settings command will both help
us manually verify our refactorings and help operators verify that our
refactorings behave expectedly when using their custom python/yaml
settings files.

Supporting info

Example output: https://gist.github.com/kdmccormick/f13d087679ca6c3ba067f03bf58b7aa1

Related to: #36131

@kdmccormick
kdmccormick force-pushed the kdmccormick/dump-settings branch 3 times, most recently from 6c7900c to c1fb2ea Compare January 24, 2025 17:08
@kdmccormick
kdmccormick marked this pull request as ready for review January 24, 2025 17:09
@kdmccormick

Copy link
Copy Markdown
Member Author

Need to handle the DisableMigrations object:

FAILED openedx/core/djangoapps/util/tests/test_dump_settings.py::test_for_cms_settings - ValueError: Not sure how to dump value <pytest_django.fixtures._disable_migrations.<locals>.DisableMigrations object at 0x7fefea8e4050> of type <class 'pytest_django.fixtures._disable_migrations.<locals>.DisableMigrations'>

This command dumps the current Django settings to JSON for
debugging/diagnostics. The output of this command is for *humans*... it
is NOT suitable for consumption by production systems.

In particular, we are introducing this command as part of a series of
refactorings to the Django settings files lms/envs/* and cms/envs/*.
We want to ensure that these refactorings do not introduce any
unexpected breaking changes, so the dump_settings command will both help
us manually verify our refactorings and help operators verify that our
refactorings behave expectedly when using their custom python/yaml
settings files.

Related to: openedx#36131

@dianakhuang dianakhuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@kdmccormick
kdmccormick merged commit dc2a38b into openedx:master Jan 27, 2025
@kdmccormick
kdmccormick deleted the kdmccormick/dump-settings branch January 27, 2025 20:29
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

leoaulasneo98 pushed a commit to aulasneo/edx-platform that referenced this pull request Jan 30, 2025
This command dumps the current Django settings to JSON for
debugging/diagnostics. The output of this command is for *humans*... it
is NOT suitable for consumption by production systems.

In particular, we are introducing this command as part of a series of
refactorings to the Django settings files lms/envs/* and cms/envs/*.
We want to ensure that these refactorings do not introduce any
unexpected breaking changes, so the dump_settings command will both help
us manually verify our refactorings and help operators verify that our
refactorings behave expectedly when using their custom python/yaml
settings files.

Related to: openedx#36131
jciasenza pushed a commit to jciasenza/edx-platform that referenced this pull request Feb 25, 2025
This command dumps the current Django settings to JSON for
debugging/diagnostics. The output of this command is for *humans*... it
is NOT suitable for consumption by production systems.

In particular, we are introducing this command as part of a series of
refactorings to the Django settings files lms/envs/* and cms/envs/*.
We want to ensure that these refactorings do not introduce any
unexpected breaking changes, so the dump_settings command will both help
us manually verify our refactorings and help operators verify that our
refactorings behave expectedly when using their custom python/yaml
settings files.

Related to: openedx#36131
UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
This command dumps the current Django settings to JSON for
debugging/diagnostics. The output of this command is for *humans*... it
is NOT suitable for consumption by production systems.

In particular, we are introducing this command as part of a series of
refactorings to the Django settings files lms/envs/* and cms/envs/*.
We want to ensure that these refactorings do not introduce any
unexpected breaking changes, so the dump_settings command will both help
us manually verify our refactorings and help operators verify that our
refactorings behave expectedly when using their custom python/yaml
settings files.

Related to: #36131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants