ci: stop rebasing pull requests that are already red (#1749) #1789
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1789
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/1117-0420"
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?
Baseline
Job:
Auto-rebase / Rebase open PRs and arm auto-merge(.forgejo/workflows/auto-rebase.yml), 24 h to 2026-11-17 04:27 UTC: n=290, median 18 s, p90 56 s, 276 success — the job itself is cheap. What it causes is not.It takes the five lowest-numbered mergeable PRs and force-pushes each onto main, and every push starts a fresh five-job matrix. When the head of the queue is stuck red, that is a matrix every few minutes for nothing. From
/actions/tasks(11,007 entries), six hours 22:27 → 04:28 UTC:Their
Test (Node 18/20/22)legs alone are 14,041 s = 3.9 runner-hours in six hours. It is still live: #1739 movedccf73f92→3f6076e7while I was measuring it, ~24 min after the previous head.Both branches are settled red on every head (
/commits/<sha>/status: three test legsfailure, classify/smoke/docker/armsuccess) and the failure is in each branch's own test file — nothing a rebase touches.Change
Read the head's statuses before the rebase. A definite failure (
failure/error) skips the push and printsPR #N: checks already failing on <sha> - not rebasing it.pendingdoes not count, so a head whose checks are still reporting is rebased exactly as before — skipping those is how a PR would sit behind main for no reason.A skipped branch no longer consumes one of the five slots (candidate window goes to four per slot; the per-run ceiling is still
batchactual rebases), so red branches at the head of the queue cannot starve the rest of it. Summary line gainsred=N.After
Same decision function, run against the live queue at 04:47 UTC:
The job runs only on
push: main/ schedule, and pull-request events are not dispatched forci/*branches on this instance, so there is no new run id to quote yet: the first post-merge tick will carryred=Non its summary line. Verification done here:bash -non the executed step, YAML parse, and the live-API run above against the real heads.Coverage unchanged
Every head still runs the full matrix, including the rebased one;
pr-rebase.ymlstill rebases on every push (which is the only event that can turn a red branch green); no check is skipped, weakened or removed. The only push not made is the one that provably cannot help.Refs: #1749, #1739, #1743.
8afab98e1e7bf7012e85After — a real run, not a prediction
The job triggers only on
push: mainand schedule, and pull-request events are not dispatched forci/*branches here, so I fired the modified workflow against this branch withworkflow_dispatchand read its log:Run 4747 (job id 11391, success, 04:38:05 → 04:38:44):
batch=5 rebased=1 current=3 conflicts=0 duplicates=1 armed=0 rearmed=0 red=0— the new counters are live and the step completes;#1787rebased, nothing else disturbed.Run 4767 (job id 11446, 04:45:28 → 04:46:37), dispatched ~2 min later once both stuck branches had a failure recorded:
Two force-pushes and two five-job matrices not enqueued, on one tick. Before the change that same tick pushed both branches — that is what produced 33 heads in six hours on #1749 alone.
Still red and unaffected by this: #1749 fails one wall-clock assertion in the test file it adds (
test/trunk-allowed-remove-from-all.test.js:167,ok(ms < 3000)), #1739 fails three stale hardcodes in existingtest/files. Both aretest/edits, which this stream will not make.