Skip to content

feat(conf): add JSON config file support#2540

Draft
cstockton wants to merge 4 commits into
masterfrom
cs/json-config
Draft

feat(conf): add JSON config file support#2540
cstockton wants to merge 4 commits into
masterfrom
cs/json-config

Conversation

@cstockton
Copy link
Copy Markdown
Contributor

@cstockton cstockton commented May 26, 2026

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 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.

Chris Stockton and others added 2 commits May 26, 2026 08:03
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.
Chris Stockton 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant