-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Simplify edx-platform settings #36215
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
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 <[email protected]>
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 <[email protected]>
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. |
This is a pure refactoring of cms/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. This is the CMS version of: * a81493c * (originally 1593923) Also included: * Add some more explicit structure to the both LMS's and CMS's production.py using big comments. * In both LMS and CMS settings, alphabetize the production overrides, and remove the extraneous comments. Separate out the handful of settings which have useful comments. The rest of the settings' comments were not helpful--they were either just stating the obvious, or they were duplicative of what's documented in common.py. Co-Authored-By: Feanil Patel <[email protected]> Part of: #36215
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 <[email protected]>
Part of: openedx#36215 Follow up in: openedx/open-edx-proposals#684
This is a pure refactoring of cms/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. This is the CMS version of: * a81493c * (originally 1593923) Also included: * Add some more explicit structure to the both LMS's and CMS's production.py using big comments. * In both LMS and CMS settings, alphabetize the production overrides, and remove the extraneous comments. Separate out the handful of settings which have useful comments. The rest of the settings' comments were not helpful--they were either just stating the obvious, or they were duplicative of what's documented in common.py. Co-Authored-By: Feanil Patel <[email protected]> Part of: openedx#36215
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 <[email protected]>
Part of: #36215 Follow up in: openedx/open-edx-proposals#684
This is a pure refactoring of cms/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. This is the CMS version of: * a81493c * (originally 1593923) Also included: * Add some more explicit structure to the both LMS's and CMS's production.py using big comments. * In both LMS and CMS settings, alphabetize the production overrides, and remove the extraneous comments. Separate out the handful of settings which have useful comments. The rest of the settings' comments were not helpful--they were either just stating the obvious, or they were duplicative of what's documented in common.py. Co-Authored-By: Feanil Patel <[email protected]> Part of: #36215
Uh oh!
There was an error while loading. Please reload this page.
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
Related / nice to have
Open questions
Potential Follow-on Work
The text was updated successfully, but these errors were encountered: