Skip to content

refactor: Clean up lms/envs/production.py cruft - #36115

Merged
kdmccormick merged 10 commits into
openedx:masterfrom
kdmccormick:kdmccormick/lms-envs-production-cleanup
Jan 16, 2025
Merged

refactor: Clean up lms/envs/production.py cruft#36115
kdmccormick merged 10 commits into
openedx:masterfrom
kdmccormick:kdmccormick/lms-envs-production-cleanup

Conversation

@kdmccormick

@kdmccormick kdmccormick commented Jan 15, 2025

Copy link
Copy Markdown
Member

Description

This is a pure refactoring of lms/envs/production.py, removing several redundant statements that have accrued over the years as the platform moved from python-only, to python+json, to python+json+yaml, to today's python+yaml setup.

Notes on some of the more involved refactorings:

  • AWS Locals Load block is handled by the YAML loading at the very top, we don't need to re-load it since there were no changes to those settings between the YAML loading at the top and this section.
  • MKTG_URL_OVERRIDES, we drop doing any overrides and remove it from the merge list beacuse the default value in
    lms/envs/common.py is empty. So the update is a no-op and is the same as just loading this data directly from the YAML config.
  • CODE_JAIL block, we've been overriding the entire dict if it is in your YAML config, so then going through and updating
    the individual values is not necessary.
  • SSL_AUTH_EMAIL_DOMAIN and SSL_AUTH_DN_FORMAT_STRING are not used anywhere in the openedx org, looks like they were used by the old dashboard djangoapp and can probably be deleted but might be used by plugins so not removing for now to keep the change backward compatible.
  • DEFAULT_FILE_STORAGE, previously two of the braches were no-ops so we only keep the one branch we need for when we want to update DEFAULT_FILE_STORAGE automatically if AWS keys are set.

Testing Instructions

We confirmed that the django settings exposed by lms/envs/production.py were identical using: https://gist.github.com/kdmccormick/9dd58fca319a6372776cd47d9136ffd3

git checkout kdmccormick/lms-envs-production-cleanup
git restore upstream/master -s lms/envs/production.py
mv lms/envs/production.py lms/envs/production_old.py
git restore lms/envs/production.py
./diff_settings.sh lms/envs/production_old.py lms/envs/production.py  # should yield a small diff of just random values

@kdmccormick
kdmccormick marked this pull request as ready for review January 15, 2025 22:47
@kdmccormick
kdmccormick force-pushed the kdmccormick/lms-envs-production-cleanup branch from be14a8f to 6c24675 Compare January 16, 2025 18:53
@kdmccormick kdmccormick changed the title refactor: Clean up lms/envs/production.py cruft (without changing any settings) refactor: Clean up lms/envs/production.py cruft Jan 16, 2025
@kdmccormick
kdmccormick requested a review from feanil January 16, 2025 20:15
@kdmccormick
kdmccormick merged commit 1593923 into openedx:master Jan 16, 2025
@kdmccormick
kdmccormick deleted the kdmccormick/lms-envs-production-cleanup branch January 16, 2025 20:19
@robrap

robrap commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

@kdmccormick: Thanks for continuing to clean up the platform!

@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.

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

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

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been rolled back from the edX production environment.

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

2U Release Notice: This PR has been rolled back from the edX production environment.

@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

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

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
Contributor

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

@kdmccormick
kdmccormick restored the kdmccormick/lms-envs-production-cleanup branch January 17, 2025 19:29
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.

4 participants