docs: register every environment variable the binary reads - #14145
docs: register every environment variable the binary reads#14145ndeloof wants to merge 1 commit into
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
~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>
c31f861 to
b940679
Compare
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
.envcan set a given variable depends on an unwritten fact — the moment it is read (flag-default time, aftersetEnvWithDotEnvinjection, or fromproject.Environment).docs/envvars.mdis now the single registry: name → read site → moment → default, including the known divergences (COMPOSE_REMOVE_ORPHANSper-command inconsistency → #14139). A guardrail test sweeps production sources forCOMPOSE_*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_BAKElisted as gone,COMPOSE_EXPERIMENTAL_WATCH_TARas recognized-but-ignored. Will be retargeted tomainonce #14085 merges.Documentation + test only, no runtime change.
🤖 Generated with Claude Code