- All playbooks
- Caching and setup
- Keep unrelated environment changes out of cache keys
Keep unrelated environment changes out of cache keys
Include inputs that can change the output while excluding branch identity and unrelated environment churn.
How companies used this technique
Read what each company changed and follow the original sources.
Keep runtime API keys out of unrelated build hashes
The build task stopped hashing RAPID_API_KEY and ANTHROPIC_API_KEY, two task-level env entries. The transferable step is proving that the build reads no runtime-only credentials.
- Use it when
- Task hashes change with secrets that are consumed only when the application runs.
- Before applying it
- Keep credentials used by build-time code generation or embedded configuration. Review secret availability separately from cache hashing.
Remove branch identity from content cache keys
A branch-name global environment variable caused different keys between Prebuild and workflow_run consumers. Mastra removed this artificial cache scope.
- Use it when
- Identical source and tool inputs miss cache when jobs see different GitHub event environments.
- Before applying it
- Only remove variables proven irrelevant to output. Cache correctness still requires all output-affecting configuration and secure write permissions.
Remove unrelated environment churn from cache inputs
Codex traced different remote cache keys for the same source tree to an unrelated tool version in the hosted Windows PATH. It now computes an explicit PATH in PowerShell and passes it to all three Bazel environments, keeping the tools the build uses.
Bazel actions see one explicit PATH across all three environments Source
- Use it when
- Identical source trees miss remote build caches after a runner image update.
- Before applying it
- A PATH allow-list can hide a required tool. Keep real tool versions in the cache inputs so a toolchain change still invalidates results.
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