ci(arm): arm the merge instead of retrying a POST its own pending check blocks #2031
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!2031
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/1118-2045"
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?
Follow-up to #2029, which found the symptom but fixed the wrong cause. #2029 has landed; this replaces its
mergeablewait with the actual mechanism.What was broken
Arm auto-mergenever merged. It spent 30-57 s per pull request doing it.Eight statuses
success,mergeable: true, and the in-job POST refused every time with405and an empty body.The cause
The caller's own commit status. While the step runs,
CI / Arm auto-mergeispendingon the head commit, and Forgejo validates a merge against every status on that commit - so the one check that says "not green" is the caller's own. It cannot turn green until the job ends, which is why three POSTs 4 s apart all got the same answer: a retry loop inside a check cannot outrun its own status. Outside the run (my manual POST at 20:38:13, 8/8 green) the identical request merged immediately.The change
Send the request that means what this step already means:
merge_when_checks_succeed: true. Both scheduled passes (auto-rebase.yml,pr-rebase.yml) already send exactly this; a PR armed here is armed the same way it would have been minutes later, and stops waiting for someone else to ask.200/201= armed,409= already armed, anything else is a refusal;successby design, and a::warning::is an annotation nobody opens).Coverage / gate unchanged
success, and all threeCI / Test (Node *)legs must be present;head_commit_idstill pins the commit whose checks were read;After-run ids will be added as a comment.
Baseline and after
Baseline -
Arm auto-merge, branch#2026, run 6627, task 17222, 32 s,success, and the pull request was not merged (same for run 6629 task 17229, 30 s). Under the intermediate fix that #2029 landed, the same job took 57 s (task 17247, run 6634) and 61 s (task 17310, run 6654, #2020) - waiting 40 s for amergeablefield that was alreadytrue.After -
Arm auto-merge, branch#2031, run 6658, task 17317: 2 s,success, 200/201 on the arm call (no refusal comment).Run wall clock, same shape of change (code PR, three test legs + smoke + docker):
That is the 30 s the arm job spent retrying a POST its own
pendingcheck was blocking.Coverage unchanged
No job, matrix leg, test, static check or timeout was removed. The status-set reader above the arm call is byte-identical: every status on the head must be
success, all threeCI / Test (Node *)legs must be present, andhead_commit_idstill pins the tested commit.Test (Node 18/20/22),Server smoke testandDocker buildall ran in run 6658.Still open (next increment)
Forgejo's own auto-merge queue is the remaining latency: this PR was armed at 20:45:36 and was still unmerged at 20:53:31 (8 min); the earlier batch (#2026-#2028, armed by the scheduled pass at 20:30:02) landed at 20:37:27-20:37:51, ~7.4 min later. So the in-workflow gate is now 2 s, but armed-to-merged is server-side. The scheduled pass (
auto-rebase.yml) arms rather than merges, and it is the piece to look at next: a directPOST /mergefrom that queue-external context merged this PR in 51 ms (HTTP 200, 20:54:00), so the fast path exists. Merged by hand at 20:54:00 for that reason.