-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 derived_settings
to lazy load settings.
#36124
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified this in the same manner as #36115
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app@94472ac4abb9:~/edx-platform$ ./diff_settings.sh lms.envs.production lms.envs.production_new
+ DJANGO_SETTINGS_MODULE=lms.envs.production
+ ./settings_wizard.py to-json
+ DJANGO_SETTINGS_MODULE=lms.envs.production_new
+ ./settings_wizard.py to-json
+ diff settings1.json settings2.json
1570,1571d1569
< "DEFAULT_ENTERPRISE_API_URL": "http://local.openedx.io/enterprise/api/v1/",
< "DEFAULT_ENTERPRISE_CONSENT_API_URL": "http://local.openedx.io/consent/api/v1/",
1817c1815,1818
< "ENTERPRISE_CONSENT_API_URL": "http://local.openedx.io/consent/api/v1/",
---
> "ENTERPRISE_CONSENT_API_URL": {
> "@@PYREF": "_generate_default_enterprise_consent_api_url",
> "@@MODULE": "lms.envs.production_new"
> },
I think you are double-wrapping ENTERPRISE_CONSENT_API_URL-- you don't need lambda settings
since it's already being assigned to a function.
a21bbac
to
0e6a0a6
Compare
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.
This was a little hard to grok so I added a little example to make it easier to understand.
0e6a0a6
to
90f37d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to push through the Derived Settings API refactor first, and then rebase this on top of that.
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.