Skip to content

docs: register every environment variable the binary reads - #14145

Draft
ndeloof wants to merge 1 commit into
docker:env-legacy-leftoversfrom
ndeloof:envvar-registry
Draft

docs: register every environment variable the binary reads#14145
ndeloof wants to merge 1 commit into
docker:env-legacy-leftoversfrom
ndeloof:envvar-registry

Conversation

@ndeloof

@ndeloof ndeloof commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Epic #14074, section D (env-var registry): ~25 recognized variables scattered across five constant files plus the compose-go-handled ones, 6 of them documented. Whether the project .env can set a given variable depends on an unwritten fact — the moment it is read (flag-default time, after setEnvWithDotEnv injection, or from project.Environment).

docs/envvars.md is now the single registry: name → read site → moment → default, including the known divergences (COMPOSE_REMOVE_ORPHANS per-command inconsistency → #14139). A guardrail test sweeps production sources for COMPOSE_* literals and fails when one has no row — the registry stays exhaustive or the build says so.

Stacked on #14085 (base env-legacy-leftovers): the registry documents the post-cleanup state — COMPOSE_EXPERIMENTAL/COMPOSE_BAKE listed as gone, COMPOSE_EXPERIMENTAL_WATCH_TAR as recognized-but-ignored. Will be retargeted to main once #14085 merges.

Documentation + test only, no runtime change.

🤖 Generated with Claude Code

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

The env-var registry and its guardrail test look correct. The test walks ../cmd, ../pkg, and ../internal, correctly filters out _test.go files and e2e directories, and asserts every double-quoted COMPOSE_* literal has a row in docs/envvars.md. The registry itself is internally consistent and the new AGENTS.md convention is clear.

One potential gap was identified (regex only matches double-quoted string literals, not backtick raw-string literals) but the verifier confirmed no production code currently uses backtick-quoted COMPOSE_* literals — the risk is theoretical and the test reliably guards the current and foreseeable codebase patterns.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ndeloof
ndeloof marked this pull request as draft August 28, 2026 05:27
~25 recognized variables were scattered across five constant files plus
the compose-go-handled ones, with 6 documented; whether the project .env
can set a given variable depended on an unwritten fact (the moment it is
read: flag-default time, after setEnvWithDotEnv injection, or from
project.Environment). docs/envvars.md is now the single registry — name,
read site, moment, default — including the known divergences
(COMPOSE_REMOVE_ORPHANS per-command inconsistency, dead
COMPOSE_EXPERIMENTAL/COMPOSE_BAKE) so the map stays truthful rather than
aspirational. A test sweeps production sources for COMPOSE_* literals
and fails when one is missing from the registry.

Epic docker#14074, section D.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof changed the base branch from main to env-legacy-leftovers August 28, 2026 06:15
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.

2 participants