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

Simplify edx-platform settings #36215

Open
9 of 16 tasks
kdmccormick opened this issue Feb 4, 2025 · 1 comment
Open
9 of 16 tasks

Simplify edx-platform settings #36215

kdmccormick opened this issue Feb 4, 2025 · 1 comment
Assignees
Labels
code health Proactive technical investment via refactorings, removals, etc. documentation Relates to documentation improvements epic Large unit of work, consisting of multiple tasks

Comments

@kdmccormick
Copy link
Member

kdmccormick commented Feb 4, 2025

Intended final settings structure

  • openedx/envs/common.py: Defaults shared between LMS and CMS (new!).

    • lms/envs/common.py: LMS default settings. Wherever possible,
      prod-ready values should be used; where not possible, obviously-incorrrect
      values should be used.

      • $THIRD_PARTY/lms/production.py: Third-party providers (like edx.org) and
        tools (like Tutor) will need to provide a custom setting settings file
        derived from common.py in order to deploy LMS.

      • lms/envs/test.py: Override LMS settings for unit tests. Should work
        in a local venv as well as in CI.

      • lms/envs/development.py: Override LMS settings so that it can run
        "bare metal" directly on a developer's local machine using debug-friendly
        settings. Will use local.openedx.io (which resolves to 127.0.0.1) as
        a base domain, which should be suitable for third-party tools as well.

        • $THIRD_PARTY/lms/dev.py: Third-party tools (like Tutor, and 2U's
          Devstack) will need to provide a custom settings file derived from
          development.py in orer to serve a local LMS.
    • cms/envs/common.py

      • $THIRD_PARTY/cms/production.py:

      • cms/envs/test.py

      • cms/envs/development.py

        • $THIRD_PARTY/cms/dev.py

Tasks

Preview Give feedback
  1. create-sandbox

Related / nice to have

  • De-crazy the logging settings overrides.
  • De-crazy the MODULESTORE settings conversions.
  • Collapse FEATURES dict
  • Warn/fail when "required" common settings, e.g. secrets, aren't overridden.

Open questions

  • When exactly do we "rebase" Tutor's settings onto (lms,cms)/envs/(common,development)? Most likely, we should do it all at once when those four files are ready, as Tutor's settings are all coupled together into a Jinja hierarchy.
  • Should the settings object should have same type signature between LMS and CMS?

Potential Follow-on Work

@kdmccormick
Copy link
Member Author

@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.

@kdmccormick kdmccormick added epic Large unit of work, consisting of multiple tasks code health Proactive technical investment via refactorings, removals, etc. documentation Relates to documentation improvements labels Feb 4, 2025
kdmccormick added a commit that referenced this issue Feb 4, 2025
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
kdmccormick added a commit that referenced this issue Feb 5, 2025
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code health Proactive technical investment via refactorings, removals, etc. documentation Relates to documentation improvements epic Large unit of work, consisting of multiple tasks
Projects
None yet
Development

No branches or pull requests

2 participants