feat(conf): add JSON config file support#2540
Draft
cstockton wants to merge 4 commits into
Draft
Conversation
Adds two new replace directives to go.mod which point to the newly
created internal/forks directory:
github.com/joho/godotenv => ./internal/forks/godotenv
github.com/kelseyhightower/envconfig => ./internal/forks/envconfig
Each one is clone of the version we use from the public repos with
no a dditional changes made. This may be a repeatable pattern we
could use to work around some limitations of older packages and
allow reaching into internals to ease migrating away from them.
added 2 commits
May 29, 2026 10:33
The first step was moving configuration loading out of the conf package to make it easier to reason about and create a clear api boundary between loading and all other operations. This required updating a good number of files, but no behavioral changes were introduced so it is simple enough to audit. The only other notable change was moving a couple e2ecfg functions into a separate package to allow them to be used without causing import cycles.
This change adds a new loader.go file within the confload pkg which adds support for loading `.json` configuration files along side existing `.env` files. The loader has been wired into the serve command which required propagation to the reloader. I've done this with the goal of minimal blast radius, a future commit may provide a more defensive interface to prevent accidentally bypassing the new configuraiton loading logic. I've omitted tests in this commit as testing is still ongoing but wanted to get the change avialable for early review.
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.
Adds two new replace directives to
go.modwhich point to the newly createdinternal/forksdirectory:github.com/joho/godotenv=>./internal/forks/godotenvgithub.com/kelseyhightower/envconfig=>./internal/forks/envconfigEach one is clone of the version we use from the public repos with no additional changes made. This may be a repeatable pattern we could use to work around some limitations of older packages and allow reaching into internals to ease migrating away from them.