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

refactor: Use derive_settings to lazy load settings. #36205

Merged

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Feb 3, 2025

Description

Some of our settings depend on the values of other settings. Rather
than explicitly looking up each one in the YAML settings file, we can
simply derive them based on the setting in the YAML file after all the
YAML settings have been loaded.

Supporting information

Originally authored by @feanil here:

BLOCKED by this derived_settings API improvement:

Part of:

Testing information

Same as #36192, but diff using this PR's branch.

@kdmccormick
Copy link
Member Author

@feanil , this PR is ready as well. It is identical to your version of the PR, except:

  • It uses the improved derive_settings API
  • It puts back two DEFAULT_ENTERPRISE_ settings (see the latest commit). These settings arguably shouldn't exist as top-level public settings, and they were probably safe to delete... but, by keeping them for now, we can continue to rest easy that production.py is 100% identical pre- and post-refactoring.

@kdmccormick kdmccormick marked this pull request as ready for review February 4, 2025 19:37
kdmccormick and others added 2 commits February 4, 2025 14:58
Some of our settings depend on the values of other settings.  Rather
than explicitly looking up each one in the YAML settings file, we can
simply derive them based on the setting in the YAML file after all the
YAML settings have been loaded.

Co-Authored-By: Feanil Patel <[email protected]>
@kdmccormick kdmccormick force-pushed the kdmccormick/use-derived-tooling branch from 82a57f3 to fc1a6f5 Compare February 4, 2025 19:58
@kdmccormick
Copy link
Member Author

I have successfully verified this using dump_settings with both Tutor's yamls and the redacted prodlike yamls. FYI @dianakhuang .

@kdmccormick kdmccormick merged commit e1a8b52 into openedx:master Feb 5, 2025
49 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/use-derived-tooling branch February 5, 2025 16:45
@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.

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