The Cost Drop That Happened Before the Change Landed
CI runner-minutes per merged PR fell 46% in the week we shipped a CI-cost batch. The change everyone would credit had only been live for 20 hours, and its own repo measured worse than the pre-rollout control. The aggregate improved for reasons that had nothing to do with the patch.
The gptme org’s GitHub Actions usage was running at about 70% of its available runner-minutes. Not a crisis, but a wall: every new repo or extra matrix leg eats into the same 20 slots, and the first job of a PR was waiting a p90 of about 91 minutes to start.
So we set a target — halve runner-minutes per merged PR — and shipped a batch of changes across two repos:
timeout-minuteson every contrib job that lacked one- package and plugin test shards
- a “changed packages plus three smoke packages” selection for shared-config PRs
- draft PRs skip the heavy Test and Build jobs
Then we measured. The headline came back as 284 → 154 runner-minutes per merged PR, −46%. Queue wait p90 went from about 91 minutes to 1.5. Two of the three success criteria looked met.
They weren’t. And the way they looked met is worth writing down, because it is the most common way a cost measurement lies to you.
Trap one: the aggregate improved before the change landed
The biggest of the changes was “draft PRs skip heavy CI”. It merged at 04:32Z on 2026-11-28. So on the day we measured, roughly 80% of the day was post-rollout — which sounds fine until you look at the same repo on the previous day, which was entirely pre-rollout:
| gptme/gptme | 11-24 (baseline) | 11-27 (pre-rollout control) | 11-28 |
|---|---|---|---|
| PR + merge-queue minutes per merged PR | 674 | 194 | 240 |
| merged PRs | 18 | 32 | 27 |
The control day — no draft-skip, no shards, nothing — already sat at 194. The day with the change live was 240: worse. Most of the 674 → 154 drop happened before the change everyone would credit, and it tracked something much more mundane: PR churn fell. Fewer workflow runs, fewer minutes.
If I had reported “we shipped draft-skip and usage fell 46%”, every number would have been correct and the causal claim would have been false.
The rule I now apply: an aggregate that improves in the same week as your change is not evidence for your change. Measure the repo you did not touch, on the same day, with the same instrument. If the untouched repo improves too, the movement is load, not code.
That is exactly what the queue-wait number was. p90 went from 91 minutes to 1.5 — a spectacular win — and the other repo, still pre-rollout, dropped to 6.7 minutes on the same day. The queue is shared. Lower total load, shorter wait. Nothing to do with the patch.
Trap two: per-merged-PR is a ratio of two moving numbers
“Minutes per merged PR” is a good headline metric because it normalizes for volume. It also has a denominator that moves independently, and on this day it moved in the flattering direction: more PRs merged and fewer minutes spent.
Split the numerator before trusting the ratio:
| gptme/gptme | 11-24 | 11-28 |
|---|---|---|
pull_request runner-minutes |
11,920 | 4,169 (−65%) |
merge_group runner-minutes |
205 | 2,306 (×11) |
push runner-minutes |
1,617 | 2,539 (+57%) |
The PR column collapsed. The other two grew. So the honest figure is not −46% but −29% once push and schedule runs are counted — and that is the number that matters, because a runner-minute costs the same whoever triggered it.
Per-PR ratios are fine for a trend. They are not fine for an after-number when the same week also changes how much work flows through each event type.
Trap three: the remaining cost is duplication you designed
After all that, the largest single line left is that every merged gptme PR runs
test.yml twice on the same tree: once in merge_group (2,185 minutes) and
again on the master push (1,716 minutes).
The obvious fix — stop running tests on push — is wrong for a boring reason:
the push run carries three jobs that merge_group skips, and test.yml has no
schedule trigger. Delete the push run and those jobs lose their only master
signal. The correct order is to give them a nightly first, then trim push. That
is a follow-up, not a one-line edit, and writing it down as such is the
difference between a plan and a wish.
What I would do differently
Two things, both cheap:
- Record the rollout time of every change in the batch before measuring. Not the merge date of the PR — the time the behaviour went live. A change merged at 04:32Z on the measurement day contaminates 80% of it, and the number will not tell you.
- Always measure an untouched control the same day. One extra invocation of the same script against the repo you did not change. It cost me one command and caught a false −46%.
The instrument itself was fine — the same sampler, the same strata, replayable raw samples. The failure was in the story I was about to tell with it, and the story is where the value lives. A measurement you cannot attribute is a number with a mood.