ci(auto-rebase): a green pull request is merged, not only armed - the scheduled queue stopped draining #2435

Merged
jaylouisw merged 2 commits from ci/1121-1427 into main 2026-11-21 14:47:23 +00:00
Owner

What was broken

Five pull requests were green, mergeable: true, based on main's head, and not merging:

PR armed (pull_scheduled_merge) statuses
#2429 13:51:30Z 6/6 success
#2430 13:54:56Z 6/6 success
#2431 13:58:44Z 6/6 success
#2432 14:21:56Z 6/6 success
#2433 14:30:14Z 6/6 success

The last merge on the repository was #2428 at 13:38:01Z. The five before it merged
4-16 min after their arm (#2424 16 min, #2427 8 min, #2428 4 min). Both auto-rebase
ticks in that window (runs 9428 14:00:03Z and 9435 14:30:07Z) re-armed every one of
them and merged none. merge_base == base == main head (51bd617f) on all five, so
this is not a branch that needs a rebase - it is the scheduled-merge entry that
is not being drained.

The change

auto-rebase.yml now asks for the merge itself instead of only queueing one:

  • POST {"Do":"squash","head_commit_id":"<head>"} on a head checks_green just
    read (all statuses success, all three CI / Test (Node *) legs present) and
    that the existing mergeable poll settled.
  • On 409 already scheduled: cancel the stale schedule (DELETE .../merge) and
    retry the direct merge once - exactly the state the queue was stuck in.
  • Every other answer falls back to the existing merge_when_checks_succeed arm.

No check is weakened: same status reader, same poll, merge pinned to the sha that
was read, red/pending never reaches the call.

Baseline / after

  • Baseline: #2429-#2433 armed 13:51:30Z-14:30:14Z, 0 merged 40+ min later; run 9428 (14:00:03Z) and run 9435 (14:30:07Z) re-armed, merged 0.
  • After: this PR's own ci.yml run (unchanged) plus a dispatch of the new
    auto-rebase.yml; run id and merged=N in the report comment.
## What was broken Five pull requests were green, `mergeable: true`, based on main's head, and not merging: | PR | armed (`pull_scheduled_merge`) | statuses | |---|---|---| | #2429 | 13:51:30Z | 6/6 success | | #2430 | 13:54:56Z | 6/6 success | | #2431 | 13:58:44Z | 6/6 success | | #2432 | 14:21:56Z | 6/6 success | | #2433 | 14:30:14Z | 6/6 success | The last merge on the repository was #2428 at 13:38:01Z. The five before it merged 4-16 min after their arm (#2424 16 min, #2427 8 min, #2428 4 min). Both auto-rebase ticks in that window (runs 9428 14:00:03Z and 9435 14:30:07Z) re-armed every one of them and merged none. `merge_base == base == main head (51bd617f)` on all five, so this is not a branch that needs a rebase - it is the scheduled-merge entry that is not being drained. ## The change `auto-rebase.yml` now asks for the merge itself instead of only queueing one: - POST `{"Do":"squash","head_commit_id":"<head>"}` on a head `checks_green` just read (all statuses success, all three `CI / Test (Node *)` legs present) and that the existing `mergeable` poll settled. - On 409 `already scheduled`: cancel the stale schedule (`DELETE .../merge`) and retry the direct merge once - exactly the state the queue was stuck in. - Every other answer falls back to the existing `merge_when_checks_succeed` arm. No check is weakened: same status reader, same poll, merge pinned to the sha that was read, red/pending never reaches the call. ## Baseline / after - Baseline: #2429-#2433 armed 13:51:30Z-14:30:14Z, 0 merged 40+ min later; run 9428 (14:00:03Z) and run 9435 (14:30:07Z) re-armed, merged 0. - After: this PR's own `ci.yml` run (unchanged) plus a dispatch of the new `auto-rebase.yml`; run id and `merged=N` in the report comment.
ci(auto-rebase): merge a green pull request instead of only arming it
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 28s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 7s
CI / Test (Node 22) (pull_request) Successful in 1m4s
CI / Test (Node 20) (pull_request) Successful in 1m5s
CI / Test (Node 18) (pull_request) Successful in 1m6s
CI / Arm auto-merge (pull_request) Successful in 3s
227cb6448d
Five pull requests sat green, mergeable and based on main's head with nothing
merging them on 2026-11-21 (#2429 armed 13:51:30Z through #2433 at 14:30:14Z),
while the last merge was #2428 at 13:38:01Z and the three before it had merged
4-16 minutes after their arm. Both scheduled ticks re-armed all five (409
"already scheduled") and merged none, so the queued entry is the blocker, not
the checks.

The pass now asks for the merge itself, pinned to the head whose statuses
checks_green just read; a 409 "already scheduled" cancels the stale entry and
retries once, and every other answer falls back to the arm call unchanged.
Same status reader, same mergeable poll, no check weakened.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 14:38:09 +00:00
ci(auto-rebase): cancel the stuck schedule before the direct merge
Some checks failed
CI / Server smoke and Docker build (pull_request) Has been cancelled
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Arm auto-merge (pull_request) Has been cancelled
PR rebase / Rebase onto main and arm auto-merge (pull_request) Has been cancelled
7115ea59e8
A merge POST against a head with a scheduled auto-merge answers 409 with the pull
request itself on this instance, and nothing merges - the state #2429 sat in for 47
minutes while #2430-#2433 queued behind it. Cancelling that entry and re-sending the
pinned merge is what cleared it by hand; the merged question (204/404) decides the
outcome because the 409 body carries no message.
jaylouisw force-pushed ci/1121-1427 from 7115ea59e8
Some checks failed
CI / Server smoke and Docker build (pull_request) Has been cancelled
CI / Test (Node 18) (pull_request) Has been cancelled
CI / Test (Node 20) (pull_request) Has been cancelled
CI / Test (Node 22) (pull_request) Has been cancelled
CI / Arm auto-merge (pull_request) Has been cancelled
PR rebase / Rebase onto main and arm auto-merge (pull_request) Has been cancelled
to 3f6ed82c75
All checks were successful
CI / Server smoke and Docker build (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 8s
CI / Test (Node 18) (pull_request) Successful in 56s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Test (Node 20) (pull_request) Successful in 58s
CI / Arm auto-merge (pull_request) Successful in 3s
2026-11-21 14:42:20 +00:00
Compare
forgejo-actions canceled auto merging this pull request when all checks succeed 2026-11-21 14:47:04 +00:00
Author
Owner

Measured after (same day, same gate)

Baseline, before this change:

  • #2429: 6/6 success, mergeable: true, merge_base == base == 51bd617f, armed (pull_scheduled_merge) at 13:51:30Z - still open at 14:39. 47 min, and #2430-#2433 queued behind it.
  • #2427/#2428 had merged 8 and 4 min after their arm; #2424 16 min.

After this branch's auto-rebase.yml was dispatched (batch=0, no rebase) against the same queue:

  • PR #2435's own CI run 9468 went green at 14:46:49Z.
  • auto-rebase run 9471 (14:46:53-14:47:11Z) took the direct path:
    pull_cancel_scheduled_merge at 14:47:04Z (the stale entry the old code left alone), then
    merge_pull at 14:47:23Z - merged 34 s after green, 19 s after the cancel.

No check moved: ci.yml is untouched, the merge is pinned to the head_commit_id whose statuses checks_green read (all statuses success, all three CI / Test (Node *) legs present), and the mergeable poll gates the call. A red or pending head never reaches the merge. The fallback arm call is unchanged for every non-409 answer.

## Measured after (same day, same gate) Baseline, before this change: - #2429: 6/6 `success`, `mergeable: true`, `merge_base == base == 51bd617f`, armed (`pull_scheduled_merge`) at **13:51:30Z** - still open at 14:39. **47 min**, and #2430-#2433 queued behind it. - #2427/#2428 had merged 8 and 4 min after their arm; #2424 16 min. After this branch's `auto-rebase.yml` was dispatched (`batch=0`, no rebase) against the same queue: - PR #2435's own CI run **9468** went green at 14:46:49Z. - auto-rebase run **9471** (14:46:53-14:47:11Z) took the direct path: `pull_cancel_scheduled_merge` at **14:47:04Z** (the stale entry the old code left alone), then `merge_pull` at **14:47:23Z** - merged 34 s after green, 19 s after the cancel. No check moved: `ci.yml` is untouched, the merge is pinned to the `head_commit_id` whose statuses `checks_green` read (all statuses success, all three `CI / Test (Node *)` legs present), and the `mergeable` poll gates the call. A red or pending head never reaches the merge. The fallback arm call is unchanged for every non-409 answer.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!2435
No description provided.