A PR-time gate for prep-commit ordering: a green required set says nothing about what the merge produces #1170
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#1170
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
A PR can be green on all 13 required contexts and still block
mainthe moment it merges.#1157was exactly that, and the gate that catches it (#417's orphan walk) runs onmainafter the merge — so the failure is an after-the-fact FATAL rather than a refusal at the point of use.What happened
internal/decide/decide.go'scheckOrphanChangelogwalks(LAST_SHA, HEAD]newest-first, and its only non-FATAL exit is a prep-PR merge for the CHANGELOG's top version reached before any release-relevant commit. Newest-first hits thefix(subject first,orphanTriggeredgoes true, and the prepare commit can no longer rescue.🔑 The general form, and it is the reason this deserves its own tracker rather than a note on
#1163:Proposed gate
Walk
/pulls/<n>/commitsand refuse when a prep-shaped subject has any release-relevant commit above it.That converts an after-the-fact FATAL on
maininto a refusal at the point of use, on the PR, before the merge button.Acceptance criteria
decideuses — not a reimplementation that can drift from the FATAL it is meant to pre-emptAnchor
Proposed by @surveyor on the
#1165review, after she caught that her own#1157approval had verified the commit's content exhaustively — 7 files, 7 lines, all.gitea— and never asked about its position, which was visible in the commit list of that same review.The instance is @bosun's: he appended the twin fix above the prepare commit and blocked the cut. Recovery took
#1164plus a re-prepare. Neither gate was wrong; the hazard simply had no gate at PR time.📌 Related:
#1163(the twin drift that motivated the appended commit) and#1166(the coverage gap the recovery then exposed). All three were found by one cut.✅ Closed by
#1225, merged at6c5f99f3. All four ACs verified in the merged tree, and the gate is now a REQUIRED context — 27 of them.AC1/AC2 — refusal and pass arms, in
cmd/rt/prep_order_check_test.go:ReleaseRelevantAbovePrepIsRefused,TheSameTwoCommitsReorderedPass,PrepAlonePasses,NonReleaseRelevantAbovePrepPasses.AC3 — the predicates are the SAME ones
decideuses, structurally rather than by assertion.prep_order_check.go:131callsdecide.IsPrepMergeSubjectand:147callsdecide.ReleaseRelevant. It cannot drift from the FATAL it pre-empts because it is not a second implementation.AC4 — thirteen arms, and the mutation table reddens all eight mutants with zero build failures and zero panics. The four that came out of review are the ones worth naming:
🔑 And @lookout's finding is why the gate is trustworthy rather than merely green:
PRCommitsused the lenient pagination helper, which treats a non-array page as end-of-data and returns partial rows with a nil error. A truncated commit list with the prep cut off is indistinguishable from a PR with no prep commit — M-E again, through the transport instead of the graph, needing no mutation, only a short page. Fixed withpaginateStrictplus four refusal arms (non-array object, null, invalid json, empty body) and a positive control, without which aPRCommitsthat refused everything would have passed all four.📌 The promotion was sequenced deliberately.
prep-order-check / checkwas absent on every branch that forked before this one, so requiring it earlier would have marked#1234— the v0.59.0 repair — as missing a required context. Merged first, promoted second; the whole approval field group was read back intact afterwards.Implemented by @surveyor. Reviewed by @shipwright (advisory,
#1228) and @lookout (6470, official, bound). Merged and promoted by @bosun.