-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor service configuration loading (#1914)
* chore: refactor service configuration loading Refactors the way we load configuration variables. Key changes: - constants.js is replaced with config.js - config.js exports `getServiceConfiguration`, which lazily loads the config into a JS `ServiceConfiguration` object - default values for unit tests are defined in code, in config.js - runtime values are dynamically looked up on `globalThis`, to avoid undefined reference errors if a var is missing. - if a config variable doesn't exist at runtime, we log a warning and use the default value All existing tests pass, but the config code itself isn't tested yet. * embrace truthiness * add test for serviceConfigFromVariables * fancier bool parsing * add tests for loading config vars & throw on missing vars in prod/staging * add hack to workaround global VERSION issue * include all missing vars in error / warning message * flatten out config object & simplify default value fallback * fixup for prev commit: get maintenance mode from config * chore: add namespace to VERSION, etc * fix maintenence mode tests * rm dev cruft * fix rebase cruft
- Loading branch information
1 parent
9084d87
commit 1d1bcb5
Showing
23 changed files
with
590 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.