fix(config): honour --config-dir in all subcommands via conf.Load#2551
Closed
thebengeu wants to merge 1 commit into
Closed
fix(config): honour --config-dir in all subcommands via conf.Load#2551thebengeu wants to merge 1 commit into
thebengeu wants to merge 1 commit into
Conversation
Previously loadGlobalConfig (used by migrate and admin) called conf.LoadGlobal which only loaded the -c/--config file and ignored -d/--config-dir, causing required keys like API_EXTERNAL_URL to be missing when supplied only via --config-dir. Introduce conf.Load(configFile, configDir) which encapsulates the full three-step load sequence (LoadFile → LoadDirectory → LoadGlobalFromEnv) used consistently by every subcommand. Both serve and loadGlobalConfig now call conf.Load, eliminating the duplication and the bug.
Contributor
|
Thanks for the PR, this is 100% a problem but I would prefer to address this once the ongoing work in #2540 is complete. I've added a similar interface for configuration loading that includes JSON support and wired it into the config reloading as well. After that is deployed we could consider calling it from |
Member
Author
|
Gotcha, will close this PR then. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously loadGlobalConfig (used by migrate and admin) called
conf.LoadGlobal which only loaded the -c/--config file and ignored
-d/--config-dir, causing required keys like API_EXTERNAL_URL to be
missing when supplied only via --config-dir.
Introduce conf.Load(configFile, configDir) which encapsulates the full
three-step load sequence (LoadFile → LoadDirectory → LoadGlobalFromEnv)
used consistently by every subcommand. Both serve and loadGlobalConfig
now call conf.Load, eliminating the duplication and the bug.