ci: typecheck takes a slot in the first dispatch wave instead of queueing behind the legs #2500

Closed
jaylouisw wants to merge 1 commit from ci/1124-0027 into main
Owner

Baseline (before). Job order in ci.yml is dispatch order. typecheck was placed last on the argument that docker + both legs + typecheck are exactly the four jobs the runner takes at once, so nothing queues behind it.

That holds on an idle host and not on this one. Measured from /api/v1/repos/jaylouisw/packetforge/actions/tasks over the 37 CI runs since the job landed (run numbers 10054-10196):

  • its task was created a median 19 s after its own run's legs (p90 50 s, worst 56 s). Run 10187 (pull #2495): tasks 26432/26433/26434 created 00:18:28-00:18:32, task 26435 (Typecheck) created 00:19:24, duration 16 s, ending 00:19:40 - 12 s after the last leg had reported.
  • in 9 of those 37 runs it was the last check in the run to finish, up to 18 s past the legs.
  • arm lists typecheck in needs, so Arm auto-merge cannot be created until that status exists. In run 10187 arm's task 26449 was created 00:21:20, 100 s after the last leg reported.

Change. Move the typecheck job to just after docker and before test - shortest job first (18 s against 52-63 s for a leg), so it owns a slot in the first dispatch wave and is never the straggler the merge gate waits on. Nothing else moves.

Coverage unchanged, proven rather than asserted. Parsing both revisions and comparing jobs.{docker,test,typecheck,arm} as objects: all four are identical; only their order in the file changed (docker,test,typecheck,arm -> docker,typecheck,test,arm). Same steps, same pinned runtimes (v22.23.5 in typecheck and on the Node 22 leg, v24.22.3 on the Node 24 leg), same PF_TEST_CONCURRENCY (12 on 22, 10 on 24), same bounds, same Typecheck / No any / Test (Node *) status names, same arm.needs. No script, test or gate touched.

After. Run 10216 (pull request #2500, head 2a234499), /actions/tasks:

  • task 26551 (Typecheck) created 00:49:34, legs 26552/26553 at 00:49:50 / 00:49:52 - 16 s before the legs where the baseline is a median 19 s after them (p90 50 s).
  • Typecheck finished 00:49:50, 80 s before the last check, and was not the straggler - against 9 of 37 baseline runs where it was the last check to report.
  • Arm auto-merge (task 26562) was created 00:51:22, 12 s after the last leg reported (baseline median 63 s), and reported success in 3 s.
  • Same coverage: 10216's legs are the usual two, Typecheck and No any are in the status set, and the four job definitions are byte-identical to main's.

Every check on 10216 is green: docker 41 s, Typecheck 16 s, Node 22 65 s, Node 24 78 s (legs slow on a contended host at 00:50Z, which is exactly the case this change is for).

**Baseline (before).** Job order in `ci.yml` is dispatch order. `typecheck` was placed last on the argument that `docker` + both legs + `typecheck` are exactly the four jobs the runner takes at once, so nothing queues behind it. That holds on an idle host and not on this one. Measured from `/api/v1/repos/jaylouisw/packetforge/actions/tasks` over the 37 CI runs since the job landed (run numbers 10054-10196): - its task was **created a median 19 s after its own run's legs** (p90 50 s, worst 56 s). Run **10187** (pull #2495): tasks 26432/26433/26434 created 00:18:28-00:18:32, **task 26435 (Typecheck) created 00:19:24**, duration 16 s, ending 00:19:40 - **12 s after the last leg had reported**. - in **9 of those 37 runs it was the last check in the run to finish**, up to 18 s past the legs. - `arm` lists `typecheck` in `needs`, so `Arm auto-merge` cannot be created until that status exists. In run 10187 arm's task 26449 was created 00:21:20, 100 s after the last leg reported. **Change.** Move the `typecheck` job to just after `docker` and before `test` - shortest job first (18 s against 52-63 s for a leg), so it owns a slot in the first dispatch wave and is never the straggler the merge gate waits on. Nothing else moves. **Coverage unchanged, proven rather than asserted.** Parsing both revisions and comparing `jobs.{docker,test,typecheck,arm}` as objects: all four are **identical**; only their order in the file changed (`docker,test,typecheck,arm` -> `docker,typecheck,test,arm`). Same steps, same pinned runtimes (v22.23.5 in typecheck and on the Node 22 leg, v24.22.3 on the Node 24 leg), same `PF_TEST_CONCURRENCY` (12 on 22, 10 on 24), same bounds, same `Typecheck` / `No any` / `Test (Node *)` status names, same `arm.needs`. No script, test or gate touched. **After.** Run **10216** (pull request #2500, head 2a234499), `/actions/tasks`: - **task 26551 (Typecheck) created 00:49:34**, legs 26552/26553 at 00:49:50 / 00:49:52 - **16 s before the legs** where the baseline is a median 19 s *after* them (p90 50 s). - Typecheck finished 00:49:50, **80 s before the last check**, and was not the straggler - against 9 of 37 baseline runs where it was the last check to report. - `Arm auto-merge` (task 26562) was created 00:51:22, **12 s** after the last leg reported (baseline median 63 s), and reported success in 3 s. - Same coverage: 10216's legs are the usual two, `Typecheck` and `No any` are in the status set, and the four job definitions are byte-identical to `main`'s. Every check on 10216 is green: docker 41 s, Typecheck 16 s, Node 22 65 s, Node 24 78 s (legs slow on a contended host at 00:50Z, which is exactly the case this change is for).
ci: typecheck claims a slot in the first wave instead of queueing behind the legs
All checks were successful
CI / Typecheck (pull_request) Successful in 16s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 7s
CI / Server smoke and Docker build (pull_request) Successful in 41s
CI / Test (Node 22) (pull_request) Successful in 1m5s
CI / Test (Node 24) (pull_request) Successful in 1m18s
CI / Arm auto-merge (pull_request) Successful in 3s
2a234499f4
Job order in this file is dispatch order. 'typecheck' sat last on the stated
assumption that docker + both legs + typecheck are exactly the four jobs this
runner runs at once, so nothing queues behind it. Measured over the 37 CI runs
since it landed, that assumption only holds on an idle host: its task was
created a median 19 s after its own run's legs (p90 50 s, worst 56 s - run
10187, task 26435 against legs 26433/26434), and in 9 of 37 runs it was the
last check in the run to report, 12 s after the last leg in 10187 and 18 s at
worst. arm lists it in needs, so each of those seconds is merge latency.

Shortest job first: 18 s here against 52-63 s for a leg. No step, script,
runtime, bound, status name or needs edge changes - the four jobs parse
identically before and after; only their order in the file moves.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-24 00:51:25 +00:00
Author
Owner

Rebase blocked on a workflow-structure conflict — needs Jay's decision.

Automated rebase watchdog, 2026-11-24 01:1x. This PR is green 6/6 on head 2a234499 but mergeable=false on two consecutive polls, so I tried the rebase in a scratch worktree. It cannot be finished mechanically.

File: .forgejo/workflows/ci.yml only (161+/147-).

What the conflict is. The PR moves the typecheck job from after test to before it (first dispatch wave). Main has since touched that job's content, so git matches the move as a deletion at the old position and the merge lands:

  • mergeable result contains two typecheck: keys — line 713 (this PR, inserted cleanly) and line 1794 (main's copy, the conflicted hunk) — which is an invalid workflow, not a merge.

Why I did not just keep one side. The two copies have diverged in content, not only position. This branch still carries the old floor guard:

case "$(node --version)" in
  v22.*|v23.*|v24.*|v25.*|v26.*) ;;

at lines 310 and 804, while main replaced it in 0c342993 (#2497, "the smoke job compares the floor, not the major number") with node scripts/check-node-floor.js --title Typecheck, because the v22.* glob accepted 22.0.0–22.17.9 — below the 22.18 floor, where .ts parses as JavaScript (#2488). Taking this branch's side silently reintroduces that bug; taking main's side deletes the move this PR exists to make. Choosing between those is a behaviour question, so per the standing rule it is not mine to answer.

Verified: 2a234499 = 6/6 success (Typecheck, Test Node 22, Test Node 24, Server smoke and Docker build, PR rebase, Arm auto-merge), 7 commits behind 8bc5fbe5; the green run predates 0c342993. No test suite was run — the rebase never got past git rebase --continue. Scratch worktree removed, nothing pushed, branch untouched.

Recommended resolution (for whoever reauthors it, pf-loop-ci or Jay): rebase onto current main, keep typecheck in the first wave before test, and carry main's check-node-floor.js call plus its surrounding comment into the moved block — main's content, this PR's position. Then re-push and let CI re-run.

Duplicate job keys are the reason this could not be accepted as-is. needs Jay's decision.

**Rebase blocked on a workflow-structure conflict — needs Jay's decision.** Automated rebase watchdog, 2026-11-24 01:1x. This PR is **green 6/6 on head `2a234499`** but `mergeable=false` on two consecutive polls, so I tried the rebase in a scratch worktree. It cannot be finished mechanically. **File:** `.forgejo/workflows/ci.yml` only (161+/147-). **What the conflict is.** The PR moves the `typecheck` job from after `test` to before it (first dispatch wave). Main has since touched that job's content, so git matches the *move* as a **deletion at the old position** and the merge lands: - `mergeable` result contains **two** `typecheck:` keys — line 713 (this PR, inserted cleanly) and line 1794 (main's copy, the conflicted hunk) — which is an invalid workflow, not a merge. **Why I did not just keep one side.** The two copies have diverged in content, not only position. This branch still carries the old floor guard: ``` case "$(node --version)" in v22.*|v23.*|v24.*|v25.*|v26.*) ;; ``` at lines 310 and 804, while main replaced it in `0c342993` (#2497, "the smoke job compares the floor, not the major number") with `node scripts/check-node-floor.js --title Typecheck`, because the `v22.*` glob accepted 22.0.0–22.17.9 — below the 22.18 floor, where `.ts` parses as JavaScript (#2488). Taking this branch's side silently reintroduces that bug; taking main's side deletes the move this PR exists to make. Choosing between those is a behaviour question, so per the standing rule it is not mine to answer. **Verified:** `2a234499` = 6/6 success (Typecheck, Test Node 22, Test Node 24, Server smoke and Docker build, PR rebase, Arm auto-merge), 7 commits behind `8bc5fbe5`; the green run predates `0c342993`. No test suite was run — the rebase never got past `git rebase --continue`. Scratch worktree removed, nothing pushed, branch untouched. **Recommended resolution** (for whoever reauthors it, `pf-loop-ci` or Jay): rebase onto current `main`, keep `typecheck` in the first wave before `test`, and carry main's `check-node-floor.js` call plus its surrounding comment into the moved block — main's content, this PR's position. Then re-push and let CI re-run. Duplicate job keys are the reason this could not be accepted as-is. **needs Jay's decision.**
Author
Owner

Superseded by #2512, which landed the same change on current main as 9221e7b0.

Why this one could not land. ci.yml conflicts against main (CONFLICT (content), verified locally with git merge-tree origin/main origin/ci/1124-0027) because this branch was cut before main's own ci.yml work and both sides rewrote the job block. Re-doing the same permutation on the current base is exactly what #2512 is: it went 6/6 green on e2e2dca3 and merged, leaving main with jobs: docker, typecheck, test, arm and arm.needs: [test, docker, typecheck] unchanged.

Nothing is lost by closing this: the ordering change, the comment rewrite and the arm.needs set are all on main now. Closing as superseded, not merging, per the duplicate-PR rule. The branch ci/1124-0027 is left in place.

Superseded by #2512, which landed the same change on current main as 9221e7b0. **Why this one could not land.** `ci.yml` conflicts against main (`CONFLICT (content)`, verified locally with `git merge-tree origin/main origin/ci/1124-0027`) because this branch was cut before main's own `ci.yml` work and both sides rewrote the job block. Re-doing the same permutation on the current base is exactly what #2512 is: it went 6/6 green on `e2e2dca3` and merged, leaving main with `jobs: docker, typecheck, test, arm` and `arm.needs: [test, docker, typecheck]` unchanged. Nothing is lost by closing this: the ordering change, the comment rewrite and the `arm.needs` set are all on main now. Closing as superseded, not merging, per the duplicate-PR rule. The branch `ci/1124-0027` is left in place.
jaylouisw closed this pull request 2026-11-24 02:53:23 +00:00
All checks were successful
CI / Typecheck (pull_request) Successful in 16s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 7s
CI / Server smoke and Docker build (pull_request) Successful in 41s
CI / Test (Node 22) (pull_request) Successful in 1m5s
CI / Test (Node 24) (pull_request) Successful in 1m18s
CI / Arm auto-merge (pull_request) Successful in 3s

Pull request closed

Sign in to join this conversation.
No description provided.