Skip to content

fix(config): honour --config-dir in all subcommands via conf.Load#2551

Closed
thebengeu wants to merge 1 commit into
masterfrom
beng/fix-config
Closed

fix(config): honour --config-dir in all subcommands via conf.Load#2551
thebengeu wants to merge 1 commit into
masterfrom
beng/fix-config

Conversation

@thebengeu
Copy link
Copy Markdown
Member

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.

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.
@thebengeu thebengeu requested a review from a team as a code owner May 28, 2026 04:49
@cstockton
Copy link
Copy Markdown
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 migrate() and addressing some other problems with the cmds as well.

@thebengeu
Copy link
Copy Markdown
Member Author

Gotcha, will close this PR then.

@thebengeu thebengeu closed this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants