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

feat: cherry pick mfe config api #526

Closed

Conversation

navinkarkera
Copy link
Member

Description

This is a backport of multiple changes which add and modify the MFE config API

Testing instructions in devstack

@navinkarkera navinkarkera self-assigned this Mar 22, 2023
@navinkarkera navinkarkera force-pushed the navin/cherry-pick-mfe-config branch from 006a3a4 to 5b71b97 Compare March 22, 2023 07:08
@navinkarkera navinkarkera force-pushed the navin/cherry-pick-mfe-config branch from 5b71b97 to c336019 Compare March 23, 2023 09:53
felipemontoya and others added 4 commits March 23, 2023 16:11
feat: add mfe config api
(cherry picked from commit 0bb4577)
Formerly, the settings were:

* `MFE_CONFIG` for common config.
* `MFE_CONFIG_<APP_ID>` for app-specific overrides,
  with each app getting its own Django setting.

This commit changes it to:

* `MFE_CONFIG` for common config (unchanged)
* `MFE_CONFIG_OVERRIDES` for app-specific overrides,
  where each app gets a top-level key in the dictionary.

Why the change?

* We want common.py to have a complete list of overridable settings, as
  it helps operators reason about configuration and allows us to generate
  config documentation using toggle annotations. Dynamically generating
  setting names based on arbitrary APP_IDs makes this impossible.
* getattr(...) generally makes code more complicated bug prone. Tools
  like pylint and mypy cannot effectively analyze any code that uses
  dynamic attribute access.

(cherry picked from commit 8edefe7)
No functional changes here. This just uses the edx_api_doc_tools package
to add some additional documentation to the new API. The documentation
can be read from the code, or viewed by visiting
http://<LMS_ROOT>/api-docs and searching for "mfe_config".

(cherry picked from commit 1b52ad5)
* This changes the API's path. The reasoning is that this is Version 1 of
  the mfe_config API, not Version 1 of the LMS's entire API, so the v1
  should come after mfe_config.
* Why does this matter? Firstly, consistency. Secondly, it affects our
  generated API documentation. If you visited
  https://courses.edx.org/api-docs, you could see that the API was
  listed under "v1" instead of "mfe_config".

(cherry picked from commit c253ec4)
@navinkarkera navinkarkera force-pushed the navin/cherry-pick-mfe-config branch from c336019 to ee49bf4 Compare March 23, 2023 10:42
@navinkarkera
Copy link
Member Author

Included commit from #527 to deploy and test at once.
cc: @farhaanbukhsh

@farhaanbukhsh
Copy link
Member

Included commit from #527 to deploy and test at once. cc: @farhaanbukhsh

@navinkarkera feel free to drop my changes now and thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants