ci(pr-rebase): a pushed head that got no run is put back, not left dead (#2082) #2090
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2090
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1119-0432"
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?
Second increment on #2082, on top of the credential guard in #2085.
What was wrong. pr-rebase force-pushed a rebased head and never looked at whether the forge created a run for it. On 2026-11-19 that left pull requests at
total_count: 0with no/actions/tasksrow at all - not created-and-cancelled, never created. A head with no statuses can never be armed, and since the rebased head sits on currentmain, no later pass revisits it: the pull request is out of CI permanently. Measured on the instance during this run:d5e15d71,882f98ec,740a4235all answerstate: "",total_count: 0, while460c9281/18838f99(pushed by the authoring loop) answer 8 statuses each. All three dead heads carrypacketforge-bot@users.noreply.git.jayw.uk, the identity only this workflow sets.What changed. After a successful push, the job reads
/commits/<pushed_sha>/status, bounded at 60 s against the measured ~25 s a dispatched push takes to report. On zero it force-pushes the branch back tohead_sha- the head it replaced, which still carries its checks - leased to the pushed sha so a concurrent push is never overwritten, says why, and stops. Behind main can merge on the checks it has; a head nothing checks cannot be merged at all. The arming path also now setshead_sha="$pushed_sha"after a checked push, so thehead_commit_idit sends names the head that exists rather than the one it replaced.Why this and not only #2085. #2085 refuses the push when the credential is the run token.
FORGEJO_TOKENis set on this repository, and the three dead heads above were pushed while it was set - so the credential guard will not fire for the reported cases, and only the answer from the forge distinguishes a rebased head that is in CI from one that is not.Tests. New
test/pr-rebase-unchecked-head.test.js(3 assertions, all failing before the change): poll is of the pushed sha and comes after the push; the zero answer restores the pre-push head under a lease on the pushed one; the step stops instead of falling through to arming; the arming payload is about the pushed head.node --test test/pr-rebase-unchecked-head.test.js test/ci-disk-hygiene.test.js-> 15 tests, 15 pass, 0 fail.node scripts/syntax-check.js-> 437 files, all OK. The step body also passesbash -n.Fixes #2082
a976b12c8f9ff7ae6b969ff7ae6b96toa976b12c8f