-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Simplify edx-platform settings #36215
Comments
@robrap , @dianakhuang -- I have split this off from the greater Let's Talk About OEP-45 issue. We'll be tracking the ongoing edx-platform settings simplification here. |
The Python API for declaring derived settings was confusing to the uninitiated reader, and also prone to spelling mistakes. This replaces the API with one that is more readable and more concise, and updates the implementation of `derive_settings` to properly derive settings declared using the new API. BREAKING CHANGE: The `derived` and `derived_collection_entry` function are replaced with the `Derived` class. We do not expect those functions to have been used outside of edx-platform, but if they are, this commit will cause them to loudly ImportError. Note that there should be NO change in behavior to the `derive_settings` function, which we DO know to be used by some external edx-platform plugins. Part of: #36215
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. Part of: #36215 Co-Authored-By: Feanil Patel <feanil@axim.org>
Ready for review: #36224 |
The Python API for declaring derived settings was confusing to the uninitiated reader, and also prone to spelling mistakes. This replaces the API with one that is more readable and more concise, and updates the implementation of `derive_settings` to properly derive settings declared using the new API. BREAKING CHANGE: The `derived` and `derived_collection_entry` function are replaced with the `Derived` class. We do not expect those functions to have been used outside of edx-platform, but if they are, this commit will cause them to loudly ImportError. Note that there should be NO change in behavior to the `derive_settings` function, which we DO know to be used by some external edx-platform plugins. Part of: openedx#36215
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. Part of: openedx#36215 Co-Authored-By: Feanil Patel <feanil@axim.org>
I'm not sure if it's too late in the game, but an approach that I am planning to take for managing the settings in my edX deployments is to develop a plugin that takes advantage of Pydantic models and either includes or vendors the logic from pydjantic. That would allow for easily managing the override of any settings via any of environment variables, YAML fragments, JSON, etc. If that could be the approach taken in the Open edX projects directly then it would save me the effort :) |
Part of: #36215 Follow up in: openedx/open-edx-proposals#684
@blarghmatey do you have any examples for this? I'm curious about how this would work. |
Intended final settings structure
See https://github.com/openedx/edx-platform/blob/master/docs/decisions/0022-settings-simplification.rst#target-settings-structure-for-edx-platform
Tasks
derived_settings
to lazy load settings. #36124derive_settings
to lazy load settings. #36205Related / nice to have
Open questions
Potential Follow-on Work
The text was updated successfully, but these errors were encountered: