A refused push and untracked files both pass silently #223
Labels
No Label
P0
P1
P2
P3
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
phase-7
phase-8
release-blocker
security
seo
ui
ux
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#223
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Seen at
a25077d(v0.9.5).What is true now.
.githooks/post-commitpushes, and exits 0 even when the push is refused, so a commit looks published when it is not.pre-pushrefuses while any tracked file is modified, which makes this easy to hit..githooks/pre-commitbuilds the working tree, not the index, so an unstaged or untracked file can make a commit pass that cannot build on its own.scripts/release.sh:211checks only tracked changes, whiledocker build .(lines 328-331) packs the working tree. An image can work while its tagged commit cannot build.What it costs. Work that exists only locally, and a release that cannot be rebuilt from its tag.
What to do. post-commit reports a failed push loudly. release.sh refuses to run while untracked, non-ignored files exist.
Verify: committing with an unrelated tracked file left modified (so pre-push refuses) prints a clear push-failure warning, and
npm run release -- --dry-runrefuses with an untracked file present and passes once it is removed.Correcting this issue's premise before anyone acts on it. Two of its three claims are wrong, observed live while committing
26136f4.post-commitdoes not pass silently. With the push refused it printed:It exits 0, which is right (a commit cannot be undone from post-commit), and it says so plainly. No change needed.
pre-commitalready warns when the guards ran against something other than the commit:What is actually left, and it is narrower:
scripts/release.sh:211checks only tracked changes, whiledocker build .packs the working tree. An image can work while its tagged commit cannot build. This is the half worth fixing.Scope is now: count untracked files in the pre-commit note, and refuse a release while untracked, non-ignored files exist.
Verify: committing with an untracked file present prints a note naming it, and
npm run release -- --dry-runrefuses while one exists and passes once it is removed.Partly fixed in
2f1e248, and partly wrong as filed. Two of the three claims were disproved live and corrected in the comment above: post-commit prints 'push was refused. The commit is safe locally and the branch is now ahead.', and pre-commit already warned when the guards ran against something other than the commit. What was real is fixed: scripts/release.sh now refuses while untracked, non-ignored files are present (docker build packs the working tree, so an untracked module produces an image that works and a tag that cannot rebuild it), and .githooks/pre-commit's note now counts untracked files as well as unstaged edits.