Narrow the dist/nginx un-ignore rule to the two tracked confs - #132
Conversation
…ng *.conf Self-review finding on this PR. `!nginx/*.conf` un-ignored ANY .conf dropped into dist/nginx/, including a generated one — which is precisely what the `*` rule exists to stop. Verified: dist/nginx/generated.conf was trackable before this change and is ignored after it, while both real files stay tracked. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012BDw71NbXZjH25q7FyMwo5
Two issues from the review of #132. The comment justified the change by saying a GENERATED conf gets dropped in dist/nginx/. Nothing does that. The only writer is the `dist` target, and it copies exactly the two files that are tracked. The narrowing is still worth having -- a glob auto-tracks whatever appears, and the leading `*` in this file exists to stop precisely that -- but the stated reason described a scenario that does not occur. Rewritten to say what is actually true. Naming the files also introduces a failure the glob did not have: a conf added later is silently untracked, so it survives on the author's disk and is missing from a fresh clone. The two places that must agree are dist/.gitignore and the `dist` target's cp lines, and neither pointed at the other. Both now do. Verified after the edits: the two tracked confs stay tracked, a third file in dist/nginx/ is ignored, and `make -n dist` still parses. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014KxvfrjQMigLtgt35REbQH
Review of #132Reviewed the change on its merits rather than as a formality — a one-line 1. The stated rationale described something that does not happen (fixed)The comment claimed the glob "would also un-ignore a GENERATED conf dropped in this directory". Nothing drops one. The only writer to cp proxy/nginx.local.conf dist/nginx/proxy.local.conf;
cp frontend-v2/nginx.local.conf dist/nginx/frontend.local.conf;— and it writes exactly the two files that are tracked. The narrowing is still worth having (the leading 2. The change introduces a failure the glob did not have (fixed)
Verified
Behaviour was checked with Out of scope, filed separatelyTwo things surfaced while establishing what this directory is for. Neither is caused by this PR and neither belongs in it.
|
mwiget
left a comment
There was a problem hiding this comment.
Review — narrow-dist-nginx-ignore @ 676dfcd
Small, self-contained, and the claim is the kind that is cheap to check rather than reason about — so I checked it. Ran git check-ignore on both branches with two would-be generated files dropped into dist/nginx/:
staging this PR
frontend.local.conf (tracked) not ignored not ignored
proxy.local.conf (tracked) not ignored not ignored
generated.local.conf not ignored IGNORED
upstream.conf not ignored IGNORED
Exactly as described: the two tracked confs are unaffected, only unlisted files change behaviour. Confirmed independently that git ls-tree -r staging dist/ yields precisely those two .conf files, and that the dist target copies precisely those two — so the explicit list is complete as of this commit.
The !nginx/ line above keeps the re-include legal (gitignore cannot re-include through an excluded parent directory), which is the part that would silently break this pattern if someone tightened the directory rule later.
On the trade
Naming files explicitly moves the failure mode from "tracks too much silently" to "tracks too little silently", and the second one is quieter — a conf missing from a fresh clone shows up as a broken install, not as a dirty git status. The PR takes that seriously in the right place: the note sits in the dist target where someone adding a cp will actually be looking, not only in .gitignore.
If you want it enforced rather than remembered, the dist target could assert that everything it copies into dist/nginx/ is tracked (git ls-files --error-unmatch) and fail the build otherwise. Not worth holding this PR for — the current comment is proportionate to a two-file list.
Approving. Behaviour verified on both branches, CI green across all 25 checks.
Lands a review fix from #121 that never reached
staging.Why this was orphaned
#121 merged at
2026-08-10T21:00:19Z. This commit (4c9fead0) was authored at22:29:39Z— 89 minutes after the merge — in response to that PR's own review round, and was pushed to a branch that had already been merged. Nothing has carried it since, sostagingstill has the broad glob.Cherry-picked onto current
stagingrather than re-proposing the original branch, which has drifted ~43 files behind and would revert unrelated work.The problem
dist/.gitignoreuses an ignore-everything-then-un-ignore pattern. The rule was:dist/nginx/is a directory that receives generated configs at runtime.*.confun-ignores those too, so a generated conf would show up as an untracked file ready to be committed — the precise outcome the surrounding*rule exists to prevent.Verified behaviour
Dropped two would-be generated files into
dist/nginx/and asked git directly:frontend.local.conf(tracked)proxy.local.conf(tracked)generated.local.confupstream.confBoth tracked files keep working; only the generated ones change behaviour.
Also confirmed the explicit list is still complete —
git ls-tree -r staging dist/shows exactly two tracked.conffiles, the two named here, with none added since August.