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: allow runtime configuration #144

Merged
merged 2 commits into from
Nov 21, 2022

Conversation

dcoa
Copy link
Contributor

@dcoa dcoa commented Nov 8, 2022

Description

This PR is part of the work to make it possible to configure the frontend applications at runtime (you can referer to this openedx/wg-frontend#103).

Changes

  • Update frontend-platform to version > 2.5.1
  • Use Helmet library to change the favicon in runtime.

Screenshot

Values come from runtime configuration
ora mfe

How to test

  • To allow runtime configuration set a new environment variables MFE_CONFIG_API_URL and APP_ID in the env file and add the api url ( To test this you can use the API from this feat: add mfe config api edx-platform#30473 or use an external tool to mock the API response).
  • The API should respond with a JSON with the config values, something like:
{
  "SITE_NAME": "Test Site",
  "LOGO_URL": "https://testimage.com/logo.svg",
  "LOGO_TRADEMARK_URL": "https://testimage.com/logo.svg",
  "LOGO_WHITE_URL": "https://testimage.com/logo.svg",
  "FAVICON_URL": "https://testimage.com/favicon.ico",
}
  • The initialize process should work normally.
    Note: You can combine buildtime and runtime configuration

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 8, 2022
@openedx-webhooks
Copy link

Thanks for the pull request, @dcoa! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@arbrandes
Copy link
Contributor

arbrandes commented Nov 9, 2022

@muselesscreator, @leangseu-edx, can you help us find a pair of eyes to review this one? There's a time component: we want to get this MFE into Tutor/Olive, and to do so we need to have the dynamic configuration support this PR provides merged in the next 2 weeks, give or take. Thanks!

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2022

Codecov Report

Merging #144 (c0f2445) into master (b1d1111) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #144   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          109       111    +2     
  Lines         1077      1081    +4     
  Branches       158       158           
=========================================
+ Hits          1077      1081    +4     
Impacted Files Coverage Δ
src/App.jsx 100.00% <ø> (ø)
src/components/Head/index.jsx 100.00% <100.00%> (ø)
src/components/Head/messages.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@leangseu-edx
Copy link
Contributor

I made some change for testing and add it to this branch https://github.com/edx/frontend-app-ora-grading/tree/dcoa/allow-runtime-config because I don't have permission to overwriting this.

@dcoa
Copy link
Contributor Author

dcoa commented Nov 20, 2022

I made some change for testing and add it to this branch https://github.com/edx/frontend-app-ora-grading/tree/dcoa/allow-runtime-config because I don't have permission to overwriting this.

Thanks for your help, I integrated the changes.

@leangseu-edx leangseu-edx merged commit c646b88 into openedx:master Nov 21, 2022
@arbrandes
Copy link
Contributor

Thanks a bunch, @leangseu-edx!

leangseu-edx pushed a commit that referenced this pull request Nov 23, 2022
* feat: allow runtime configuration

* test: organize Head test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants