-
Notifications
You must be signed in to change notification settings - Fork 94
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: set up dashboard to deploy js configs #304
feat: set up dashboard to deploy js configs #304
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #304 +/- ##
=======================================
Coverage 96.62% 96.62%
=======================================
Files 182 182
Lines 1747 1747
Branches 308 308
=======================================
Hits 1688 1688
Misses 55 55
Partials 4 4 ☔ View full report in Codecov by Sentry. |
src/config/index.js
Outdated
// This mergeConfig ensures that any variables assigned by process.env are still overwritten if declared in JS config | ||
mergeConfig(envConfig); | ||
|
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.
Does this not already happen in frontend-platform?
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.
You're right, it does, and I realize now that I added this additional mergeConfig
because at one point I was trying to handle the scenario where the .env.*
files would be removed, but I now know that that isn't something I should have to anticipate while adding the risk of variables over-writing each other repeatedly. Removing this logic for now.
This PR introduces a patch in Learner Dashboard's
frontend-build
dependency that allows for JS configs to be handled in a production build. This also includes further handling in the Jest config to accept both JS and JSX configs.setupTest.js
due to there being no plans to remove.env.test
in the near futuremergeConfig
inconfiguration.js
to ensure JS config variables will still overwrite any previously-assignedprocess.env
variables. (this aligns with the predictable order of environment variable assignment in frontend-build)APER-3085
Scenarios I tested for (via
npm run test
andnpm run start
:env.config.js
exists,.env.*
files untouchedenv.config.js
file exists and.env.*
files untouched