- All playbooks
- Move optional cache uploads off the merge gate
Move optional cache uploads off the merge gate
Let required checks finish without waiting for optional cache publication, while keeping cache writes available to later runs.
How companies used this technique
Read what each company changed and follow the original sources.
Let optional cache writes finish after the merge gate
Linear moved cache-marker writes into a job downstream of the test shards that gates nothing. That took 42 seconds off the merge path for every API pull request and merge-queue entry.
This change took 42 seconds off the merge path. Together with the checkout changes before it in Linear’s post, the section took roughly a minute off the required check for API pull requests on cache misses, while also reducing runner starts. Source
- Use it when
- A write only benefits future runs and is not part of the current run’s correctness.
- Before applying it
- Keep every test, required status and artifact dependency. Confirm the current run’s correctness never depends on the write before moving it off the required checks.
Keep cache uploads outside required test jobs
The CLI's required native help jobs now restore caches without compressing and uploading them after the tests. Windows x64 restores the archive other CI jobs produce; main-only warmers own the saves, capped at five minutes and non-fatal.
Required native jobs restore caches; warmers on main save them Source
- Use it when
- Tests pass but post-job cache compression eats into the job's deadline.
- Before applying it
- A restore-only job needs a compatible trusted producer that runs often enough to keep the cache warm. Keep required checks and their limits as they are.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed