ci(auto-rebase): do not mint a head nothing will check #2059

Merged
jaylouisw merged 3 commits from ci/1119-0044 into main 2026-11-19 01:09:02 +00:00
Owner

What is broken

Every auto-rebase pass force-pushes the branches that are behind main. The head it mints often gets no CI run at all, and a head with no checks can never be armed (checks_green needs three CI / Test (Node *) statuses; the merge POST needs every status on the head to have reported).

Evidence, /api/v1/repos/jaylouisw/packetforge/actions/tasks keyed by head_sha:

PR head minted at 2026-11-18 22:07Z CI tasks on that head
#2040 816c1f38 0
#2038 1169554d 0
#2037 bf3f2220 0
#2035 6320501e 0
#2033 9df7b89b 0

Those five only merged after a human pushed or closed-and-reopened them, and each merge repeated the freeze on the rest of the queue (see the #2033 timeline).

Reproduced on this PR while it was open: auto-rebase pushed 2a3f751c -> a9384edf -> 237fc3cc, and /commits/<sha>/status answered total_count: 0 for both new heads.

What does not fix it

workflow_dispatch of ci.yml. Run 6872 dispatched ci.yml against a9384edf: Classify, all three test legs, smoke and Docker ran and passed - and /commits/a9384edf/status still returned total_count: 0. The jobs run; the statuses the gate reads are not written. (First commit on this branch tried that; it is disproven and superseded.)

The change

A push made with a user token does raise the event: pushing 237fc3cc..4e94088d to this PR with the repository token produced eight statuses on the new head inside 25 s.

So the pass now tells which credential it holds (RUN_TOKEN: ${{ github.token }}):

  • with a user token (FORGEJO_TOKEN): behaviour unchanged - rebase, push, then verify the new head actually has checks and count the ones that do not (no_checks=);
  • with only the run token: leave the branch alone. A behind-main PR can still merge (block_on_outdated_branch: false on main, read from /branch_protections), while a head nothing checks cannot merge at all. The pass says so once, and the re-arming pass still runs.

Coverage unchanged: same classifier, same three Node legs, same smoke and Docker jobs, same checks_green gate. Nothing is skipped, retried or weakened - the change only stops the workflow destroying a state (green checks) it cannot recreate.

Checks

node test/ci-disk-hygiene.test.js 12/12 pass (the df -Pk guard and the uses: actions/checkout@ it pins are untouched).

## What is broken Every `auto-rebase` pass force-pushes the branches that are behind `main`. The head it mints often gets **no CI run at all**, and a head with no checks can never be armed (`checks_green` needs three `CI / Test (Node *)` statuses; the merge POST needs every status on the head to have reported). Evidence, `/api/v1/repos/jaylouisw/packetforge/actions/tasks` keyed by `head_sha`: | PR | head minted at 2026-11-18 22:07Z | CI tasks on that head | |---|---|---| | #2040 | `816c1f38` | 0 | | #2038 | `1169554d` | 0 | | #2037 | `bf3f2220` | 0 | | #2035 | `6320501e` | 0 | | #2033 | `9df7b89b` | 0 | Those five only merged after a human pushed or closed-and-reopened them, and each merge repeated the freeze on the rest of the queue (see the #2033 timeline). Reproduced on this PR while it was open: `auto-rebase` pushed `2a3f751c -> a9384edf -> 237fc3cc`, and `/commits/<sha>/status` answered `total_count: 0` for both new heads. ## What does *not* fix it `workflow_dispatch` of ci.yml. Run **6872** dispatched ci.yml against `a9384edf`: Classify, all three test legs, smoke and Docker ran and passed - and `/commits/a9384edf/status` still returned `total_count: 0`. The jobs run; the statuses the gate reads are not written. (First commit on this branch tried that; it is disproven and superseded.) ## The change A push made with a **user** token does raise the event: pushing `237fc3cc..4e94088d` to this PR with the repository token produced eight statuses on the new head inside 25 s. So the pass now tells which credential it holds (`RUN_TOKEN: ${{ github.token }}`): - with a user token (`FORGEJO_TOKEN`): behaviour unchanged - rebase, push, then verify the new head actually has checks and count the ones that do not (`no_checks=`); - with only the run token: leave the branch alone. A behind-main PR can still merge (`block_on_outdated_branch: false` on `main`, read from `/branch_protections`), while a head nothing checks cannot merge at all. The pass says so once, and the re-arming pass still runs. Coverage unchanged: same classifier, same three Node legs, same smoke and Docker jobs, same `checks_green` gate. Nothing is skipped, retried or weakened - the change only stops the workflow destroying a state (green checks) it cannot recreate. ## Checks `node test/ci-disk-hygiene.test.js` 12/12 pass (the `df -Pk` guard and the `uses: actions/checkout@` it pins are untouched).
ci(auto-rebase): dispatch CI for a head this pass force-pushed and nothing else checked
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 9s
CI / Server smoke test (pull_request) Successful in 12s
CI / Docker build (pull_request) Successful in 22s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 22) (pull_request) Successful in 52s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 2s
2a3f751cc3
Every rebase push mints a head. Measured 2026-11-18 22:07Z: one pass left five
heads with zero CI tasks (#2040 816c1f38, #2038 1169554d, #2037 bf3f2220,
#2035 6320501e, #2033 9df7b89b), and checks_green needs three CI / Test
(Node *) statuses, so those pull requests could not be armed at all until a
human pushed or reopened them.

After a successful push the pass now waits up to 20 s for checks to appear on
the new head and, only if there are none, dispatches ci.yml for that branch.
A head that already got a run from synchronize is not dispatched twice.

Coverage unchanged: same gate, same three test legs, smoke and Docker; this only
creates the run a missing synchronize event would have created.
forgejo-actions force-pushed ci/1119-0044 from 2a3f751cc3
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 9s
CI / Server smoke test (pull_request) Successful in 12s
CI / Docker build (pull_request) Successful in 22s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 22) (pull_request) Successful in 52s
CI / Test (Node 18) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 2s
to a9384edf7d 2026-11-19 00:46:33 +00:00
Compare
ci(auto-rebase): check the head the rebase push minted, and name the one that got no checks
All checks were successful
CI / Classify the change (pull_request) Successful in 6s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 4s
CI / Server smoke test (pull_request) Successful in 10s
CI / Docker build (pull_request) Successful in 23s
CI / Test (Node 20) (pull_request) Successful in 51s
CI / Test (Node 22) (pull_request) Successful in 54s
CI / Test (Node 18) (pull_request) Successful in 1m0s
CI / Arm auto-merge (pull_request) Successful in 3s
4e94088d03
Dispatching ci.yml after the push does not repair a head with no statuses: run
6872 (workflow_dispatch, head a9384edf) ran the full matrix green and
/commits/a9384edf/status still answered total_count 0. So the pass now reads the
status set on the head it just pushed and reports the condition instead of
assuming the push produced a run.
ci(auto-rebase): do not mint a head nothing will check
All checks were successful
CI / Classify the change (pull_request) Successful in 9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 4s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 43s
CI / Test (Node 18) (pull_request) Successful in 1m3s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 1m0s
CI / Arm auto-merge (pull_request) Successful in 4s
871ecfd2e7
A rebase pushed with the run's own token raises no pull_request event, so no run
is created for the head it mints, and a head with no checks can never be armed
(checks_green needs three CI / Test statuses; the merge POST needs every status
on the head). Measured 2026-11-18 22:07Z, five heads from one pass had zero CI
tasks: #2040 816c1f38, #2038 1169554d, #2037 bf3f2220, #2035 6320501e, #2033
9df7b89b. Those pull requests only merged after a human pushed or reopened them.

Dispatching ci.yml afterwards is not a substitute: run 6872 (workflow_dispatch on
a9384edf) ran the whole matrix green with total_count 0 on the commit. A user
token's push does raise the event (237fc3cc..4e94088d on #2059 produced eight
statuses in 25 s), so when the pass holds only the run token it now leaves the
branch where it is - behind main still merges (block_on_outdated_branch is
false), a head nothing checks does not - and the pass says why, once.

Coverage unchanged: same classifier, same three test legs, smoke and Docker; the
re-arming pass still runs either way.
jaylouisw changed title from ci(auto-rebase): dispatch CI for a head this pass force-pushed and nothing else checked to ci(auto-rebase): do not mint a head nothing will check 2026-11-19 00:55:14 +00:00
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-19 01:00:25 +00:00
jaylouisw deleted branch ci/1119-0044 2026-11-19 01:09:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2059
No description provided.