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

feat: dump_settings management command #36162

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Jan 23, 2025

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
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
Copy link
Contributor

@dianakhuang dianakhuang left a comment

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
49 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/dump-settings branch January 27, 2025 20:29
@edx-pipeline-bot
Copy link
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
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
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