Skip to content

feat(ci-timing): measure CI wall, wait and long pole per run class (RIG-5488) - #2326

Merged
mattwilkinsonn merged 3 commits into
mainfrom
ci/rig-5488-ci-timing
Oct 16, 2026
Merged

mattwilkinsonn merged 3 commits into
mainfrom
ci/rig-5488-ci-timing

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds tools/ci-timing, the measurement tool from the CI PR-speed design (§ T1). It produces before/after tables for each of the remaining speed slices.

  • core.ts is pure.
    • classify sorts each ci.yml run into a class: pr, queue (a pull_request on trunk-merge/**), merge_group, push, schedule or dispatch.
    • summarize gives each class: wall time; per-run max runner wait; per-job wait and duration quantiles; skip rate; long-pole share; runner minutes; and the UTC hours with a job wait over 120 s.
    • Cancelled runs are counted, not kept.
    • The rollup aggregator waits on every job, so it is left out of the long-pole count.
  • index.ts reads runs and their jobs through gh api --paginate and prints Markdown tables, or JSON with --json.
    • A listing past GitHub's 1000-result search cap fails loudly instead of truncating.
    • Usage: bun tools/ci-timing/index.ts --since 2026-10-01 [--until …] [--json].

28-day baseline (pr class)

Week from Kept Cancelled Wall p50 s Wall p90 s Max wait p50 s Max wait p90 s Runner min p50 Top long pole
2026-09-17 173 50 1006 1349 4 22 67 moon (nix) 38%
2026-09-24 282 100 1042 1377 7 54 78 pgtest 35%
2026-10-01 524 182 1164 1775 8 317 85 e2e 62%
2026-10-08 568 277 1373 2336 8 833 75 e2e 75%

Tests

  • core.test.ts covers every run class, the cancelled-run exclusion, skip rate and long-pole share, quantiles at n = 1 and n = 2, and the over-120 s hour buckets.
  • It also pins the aggregator exclusion and checks that rollup in ci.yml still waits on e2e. Removing the exclusion fails the test.
  • index.test.ts covers the API edge: a listing cut short of total_count fails, a complete multi-page listing passes, a timed_out job is read as a failure that ran, and an unknown conclusion fails.
  • bun test: 12 pass. tsc --noEmit and biome ci are clean.
  • Smoke: a live run over 2026-10-15 printed every class table. Its pr long-pole shares were e2e 44%, pgtest 28% and moon (nix) 20%.

Design: docs/designs/compass/ci-pr-speed.md § T1 in RigelBuild/docs. Issue: RIG-5488.

rigel-mintaka and others added 2 commits October 15, 2026 23:14
…IG-5488)

New tools/ci-timing bun project: a pure summarize() over ci.yml runs by class
(pr, queue, merge_group, push, schedule, dispatch) and a gh api edge that
prints per-class tables or JSON.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…RIG-5488)

rollup needs every work job, so it always finished last and took 100% of
the long-pole share. A test pins that it waits on e2e in ci.yml.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

RIG-5488

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://ci-rig-5488-ci-timing.compass-eng-docs.pages.dev

Deployed from ci/rig-5488-ci-timing at 2b218b6.

Changed pages:

Map GitHub job conclusions such as timed_out onto the record's four
instead of aborting the report, and cover the 1000-run cap guard and the
conclusion mapping with fixture tests.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review loop on head 2b218b68 (base main 888ac07e).

  • Round 1 at 4a961ed9: one high (no test for the 1000-run cap guard) and one medium (timed_out jobs aborted the report). Both are fixed in 2b218b68; each new test fails when its guard is removed.
  • Round 2: high 0, medium 0, low 0.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 16, 2026 04:12
@mattwilkinsonn
mattwilkinsonn merged commit dd99fc1 into main Oct 16, 2026
21 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the ci/rig-5488-ci-timing branch October 16, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants