GRI-582: the hook reads the branch name it was already printing #4
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!4
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/GRI-582-pre-push-issue-key"
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?
The hook printed the branch shape in its own help text and never read it
.githooks/pre-pushhere refused a push tomainordev, told the readerthat a branch is called
feature/GRI-nn-...— and then accepted any name atall. Rule 10 was a paragraph the hook had never read.
It also had no test. Nothing anywhere executed it: it is the one piece of
prevention the branch rules have,
scripts/local-gates.shfails when it is notinstalled, and no suite drove it. That is the GRI-424 shape, where
Merge guardwas red on 38 of 38 runs because it could only ever run in CI.
What changes
.githooks/pre-pushrefuses a branch whose name carries noGRI-<digits>key, case-sensitively. An off-list kind is a warning andnot a refusal. Deleting an unprotected branch stays allowed — that is how a
finished branch leaves, and the sweep needs it. The hook reads the name
only, so a board outage cannot block a push for a reason unrelated to the
branch.
scripts/tests/pre-push-test.sh— 30 assertions, 30 passing, driven theway git drives it, one ref line per push: both refusals, the warning, the
deletion case, a tag, a lower-case key,
GRI-with no digits, an unresolvableremote head, a push with both violations at once, and the installer's four
--checkstates.scripts/local-gates.shruns it as a gate, and CI runs it as a jobthat needs no toolchain. It is in the
CIroll-up'sneeds, so a skipped runis not a pass.
plan/process/branching-and-release.md, with the sweepthat detects what the hook cannot prevent.
The sweep, with the two shortcuts that are wrong
Rule 11 deletes a branch only when both hold, in the same pass: its key
belongs to no open issue, and
git cherry origin/dev <branch>reportsnothing.
"not in
dev" when the patch-id test said 24. A sweep written againstancestry would have deleted 72 live branches, because a squash merge gives
the work a new commit no ancestry test can match.
merged pull request and still held patches
devdid not have — what areverted merge leaves behind.
Archive before deleting, and the order matters: a tag is a ref, so a commit a
tag holds can never be pruned. The round trip (
POST /tags→DELETE /branches/{name}→POST /brancheswithold_ref_name) was rehearsed againstthe live forge and restores the identical sha. With the tag, a wrong deletion
costs one API call to undo; without it, it is permanent.
Three statements in these documents were false, and are corrected
Not left for the next reader to believe:
"nothing on the server can refuse a bad push, at any permission level".
GitHub is gone since 2026-10-17, and this forge applies protection to
devand
mainin this repository — five required gate contexts ondev, theCIroll-up plus two approvals onmain— for repository admins too. ADR0002 now records that its premise expired, and why its controls are kept
anyway: rule 10 has no server-side half on any forge, because
DISABLE_GIT_HOOKScorrectly keeps per-repository git hooks off.branch-guard.ymlthis repository does not have.22 issues reach
donewith their work not indev, 16 of them with no pullrequest in existence when they were closed. A push is not the finish line;
donemeans the work is an ancestor ofdev.Rule 5 also credited GitHub with running the gates, and called the runner a
clean machine. It is on the same build host as the working trees, so what it
buys is isolation from the working tree, not an independent opinion.
Merges cannot freeze on this
The new
hooksjob adds no required status context.devhere requires thefive named gate contexts and not an aggregate, which is the shape that avoids
GRI-683 — where one never-dispatched
CI / CIrequirement froze 39 of 39Helpdesk pull requests while every real gate on them was green. Adding
CI / the pre-push hookto the required list is a separate change and should come afterthis merges, never before.
Verification
scripts/tests/pre-push-test.sh30/30,bash -n scripts/local-gates.sh, theworkflow parses and the
cijob'sneedsreads back withhooksin it. NoRust or front-end file is touched, so the cargo and npm gates are the forge's to
confirm on this pull request.