-
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
docs: Settings Simplification ADR #36224
base: master
Are you sure you want to change the base?
Conversation
ba09230
to
57f550a
Compare
@feanil , could you take a first pass? Once it looks good to you, I'll circulate it more broadly. |
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.
A few minor comments but nothing major. I can re-review once those are addressed.
@regisb , your wisdom on this ADR would be invaluable. |
57f550a
to
c8e03af
Compare
Sorry @feanil , forgot to push. Ready now. |
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.
Looks good to me now.
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.
Reading this ADR, I found myself nodding and mumbling "yes, yes, ok..." all the way down. I used to tell people that there are just two things which are difficult in Open edX: static assets and settings. I'm grateful that you are tackling the latter after having greatly improved the state of the former.
My comments are mostly questions for my own understanding. As far as I'm concerned this is good to go.
Decision | ||
******** | ||
|
||
This is our target edx-platform settings module structure: |
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.
This is a greatly simplified structure, and I'm all in favor of it. But I expect that it's going to create issues for some settings that derive from others.
To clarify, I'm talking about the following scenario:
- common.py defines
SETTING_BASE = ...
andDERIVED_SETTING1 = foobar1(SETTING_BASE)
andDERIVED_SETTING2 = foobar2(SETTING_BASE)
. - production.py modifies
SETTING_BASE
.DERIVED_SETTING1
andDERIVED_SETTING2
need to be re-defined.
This is for instance what currently happens with STATIC_ROOT_BASE
, from which STATIC_ROOT
, WEBPACK_LOADER
are derived.
How do you expect we are going to resolve these cases? I see 3 possible approaches:
- Be dumb about it and duplicate settings in common.py and production.py.
- Somehow preserve the existing
derive_settings
mechanism. (by the way, are we going to keep it around?) - Refactor settings such that we don't have to duplicate settings.
Approach 3 would probably be the "right" one, but I expect we'll have to make this decision on a case-by-case basis.
(I'm sure you've thought about this but I don't see it reflected in this ADR. Or is it part of the "Remove redundant overrides" paragraph below?)
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.
Great question, silly of me to omit that from the ADR.
Having looked through the modules with @feanil a lot lately, we feel that (1) would add lot more work for operators and (3) is just an infeasibly large amount of work and breaking changes. I don't love having bespoke tooling, but if we have to keep some bespokeness around, I think that derived_settings is pretty tame and well-defined. So I propose (2). Specifically, the three common.py files would have a lot of derived defaults. Lmk what you think.
Relatedly, in preparation for this, I have already made the derived_settings API a bit easier to work with: #36192
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 OK with some bespoke tooling. Like I said, I expect that we might be able to use approach 3 for some settings. If anything, derive_setting
will help us identify settings that should be simplified, and we can take on those further down the road.
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 expect that we might be able to use approach 3 for some settings. If anything, derive_setting will help us identify settings that should be simplified, and we can take on those further down the road.
I agree. The dependencies between different settings will become much clearer and easy-to-untangle once we have converted all the production.py-special-cases into explicit common.py Derived
settings.
c8e03af
to
7883fc4
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.
Thank you.
* BREAKING (major, just common.py): Find the best production-ready defaults | ||
between both (lms,cms)/envs/production.py and Tutor's production.pys, and | ||
"bubble" them up to (openedx,cms,lms)/common.py. Keep | ||
(lms,cms)/envs/production.py unchanged through this process. |
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.
If the production.oy files remain unchanged, can you better explain the breaking change aspect of this, and what we expect to break or not break? Also, maybe note the action to be taken to workaround the breaking change, if applicable?
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.
If someone is directly using common.py, changes to those common.py defaults may be a breaking change to them. I'm not aware of any specific site using common.py directly, but we can't count out the possibility. When we merge the breaking commits, we will include a list of defaults that have changed, which the operators can react to.
I can update the ADR to clarify.
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.
Updated
63b8644
to
8da96ec
Compare
in a local venv as well as in CI. Needs to invoke ``derive_settings`` in | ||
order to render all previously-defined ``Derived`` settings. | ||
|
||
* ``<third_party_repo>/lms_prod.py`` (example path): In order to |
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.
Thanks @kylecrawshaw. A couple of thoughts:
- First, I realized that the term third-party was confusing to me. In the context of the Open edX platform, I'm used to the term third-party being applied to libraries (e.g. Django, DRF) and tools. Even the term third-party provider, I would typically associate with examples like: AWS, Azure, Confluent, etc., and not with Open edX providers, unless specifically designated.
- a. Below you used the phrase "third-party providers (like edx.org)", and that was clear to me, but only because the example was
edx.org
, and it took me a moment to re-orient myself. I'm wondering if switching this to "Open edX providers (like edx.org)", or something like that, would be more clear? - b. The reference
<third_party_repo>
is again ambiguous (on its own, and it is opening this paragraph), and maybe this could be<open_edx_provider_repo>
? I also realized that you wanted a term that would cover tools like Tutor. Maybe<open_edx_provider_or_tool_repo>
? - c. Related, there are a bunch of references to third-party settings in this ADR, and now I'm not clear which are third-party library settings, and which are Open edX provider settings? Maybe you could search for third-party through the ADR and double-check whether being slightly more explicit will bring clarity?
- This step is written as if it is required, but the consequences section better details the possible alternative of using
lms/envs/yaml.py
. Maybe that was part of my original confusion? Is there some way to make this clear, if I am understanding correctly?
* Propose and, if accepted, implement an update to OEP-45 (Configuring and | ||
Operating Open edX). `Progress on this update is tracked here`_. As mentioned | ||
in the Decision section, this update will either: | ||
|
||
1. Revoke the OEP-45 sections regarding YAML. Deprecate and remove | ||
(cms,lms)/envs/production.py. This is a BREAKING CHANGE for tools and | ||
providers that use these settings modules, as they will either need to | ||
maintain local copies of these modules, or "rebase" their internal | ||
settings modules onto (cms,lms)/envs/common.py. Update operator | ||
documenation as needed. | ||
|
||
2. Update OEP-45 to clarify that YAML configuration is | ||
optional. Operators can opt out of YAML by deriving directly from | ||
(cms,lms)/envs/common.py, or they can opt into YAML by using | ||
(cms,lms)/envs/yaml.py. Document a simplified YAML schema in OEP-45. | ||
There will be several well-communicated BREAKING CHANGES in YAML behavior | ||
in order to achieve the simplified schema. Furthermore, the rename of | ||
(cms,lms)/envs/production.py to (cms,lms)/envs/yaml.py will be a BREAKING | ||
CHANGE. |
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.
- How will this sub-decision get made, and will this ADR be updated to reflect that commitment?
- Could this be made less ambiguous at this time? It seemed to me that the current thought is to support a
yaml.py
, with the caveat that we might learn something along the way that convinces us to deprecate this and push it to Open edX providers. If this is accurate, could we document it? If not, maybe you add an Out of Scope section to this ADR, and detail that it is unknown whetheryaml.py
will be supported in the platform, or deprecated in favor of Open edX providers adding in this functionality to their own settings files as needed.
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.
- How will this sub-decision get made, and will this ADR be updated to reflect that commitment?
The ADR currently says:
Finally, based on what we learn throughout this process, our OEP-45 proposal will either recommend to:
- ...
- ...
which I felt was enough commitment and detail for an ADR. As with any OEP update, there will be an opportunity to debate the proposed decisions.
Could this be made less ambiguous at this time? It seemed to me that the current thought is to support a yaml.py, with the caveat that we might learn something along the way that convinces us to deprecate this and push it to Open edX providers. If this is accurate, could we document it? If not, maybe you add an Out of Scope section to this ADR, and detail that it is unknown whether yaml.py will be supported in the platform, or deprecated in favor of Open edX providers adding in this functionality to their own settings files as needed.
I think this is an area where you, I, and @feanil all feel differently. Personally, I have felt, and still feel, that production.py is so complex and bespoke that deprecating it and pushing it to Open edX providers will actually be easier for all involved parties than performing (and reacting to) the surgical breaking changes that'd be necessary to get it to a point of having a simple, well-documented, and generally-useful "yaml.py". But, I could be wrong, and I don't think we will be able to come reach consensus on this until we have already gotten our hands dirty coding. Hence, the ambiguity.
You're right, I didn't even realize I was using 3rd-party to mean two different things. I'll update to disambiguate.
Ah, fair. The uncertainty of whether we implement |
https://github.com/kdmccormick/edx-platform/blob/kdmccormick/settings-adr/docs/decisions/0022-settings-simplification.rst