The Spectrum Dispatch News

technology

AI Coding Speed Creates CI Bottleneck; Linear Reworks Pipeline to Keep Up

As AI agents accelerate code shipping, continuous integration lags behind. Linear optimized its CI to cut PR wait time and runner costs despite test suites growing 4x.

AI Coding Speed Creates CI Bottleneck; Linear Reworks Pipeline to Keep Up

AI-assisted coding has made continuous integration (CI) a bottleneck at Linear. According to the company, agents have made shipping code exponentially faster, but validating those changes hasn’t kept pace. Every pull request must still pass through CI, so as development accelerates, the validation pipeline becomes a constraint, driving up infrastructure costs and leaving developers waiting longer for feedback.

AI Coding Speed Creates CI Bottleneck; Linear Reworks Pipeline to Keep Up

Linear’s engineering team, led by CTO Tuomas, tackled the problem by optimizing how long a PR waits on CI and how much runner time it consumes. Despite test suites nearly quadrupling since the start of the year, the company brought PR wait time down from more than 6 minutes to just over 5 minutes while cutting runner time per test roughly in half.

The company pursued four broad improvements:

Infrastructure and Tooling Upgrades Moving workloads from GitHub Actions to third-party runners with faster CPUs and better cache infrastructure yielded immediate gains—jobs ran 34% faster on average, with some workloads like TypeScript compilation dropping 52%. Switching to tsgo, a native TypeScript compiler, cut the weekly median of type-checking by 73%, removing that step as a bottleneck entirely.

Optimized Linting Linear rewrote custom lint rules that depended on TypeScript type information to use static analysis instead. This let ESLint drop TypeScript entirely, reducing API lint time by 68% and full-repository lint time by 55%. The change also made later migration to Oxlint simpler and further reduced runner-minutes spent on linting.

Critical-Path Jobs The team identified small jobs sitting at the front of every CI run—change-detection checks that gate everything else—and optimized them. They reduced repository fetches to only required subsets, cutting the slowest gate from 94 seconds to 20 seconds. A custom checkout action with retry logic and connection timeouts replaced standard GitHub checkout, making the pipeline more resilient to network instability.

Reduced Setup Overhead Linear created a custom CI base image containing Node and dependencies, eliminating repetitive installation steps. For its monorepo, the team restricted dependency installation to only needed packages rather than the entire workspace, cutting pnpm install from 44-73 seconds to 16-18 seconds. Database setup was optimized by loading schema snapshots instead of replaying full migration histories, reducing setup from 12 seconds to 1-2 seconds per container.

Linear’s codebase is primarily TypeScript, though the company notes these optimizations apply across languages and toolchains. The changes together reduced per-shard setup time by roughly 44% and removed roughly a minute from the required check for API pull requests on cache misses.

Key facts

  • PR wait time reduced from 6+ minutes to just over 5 minutes despite test suites quadrupling
  • Runner time per test cut roughly in half
  • Third-party infrastructure switch made jobs run 34% faster on average
  • TypeScript compilation (tsc) cut 73% with native compiler switch
  • API lint time reduced 68%; full-repository lint 55%
  • Database setup optimized from 12 seconds to 1-2 seconds per container
  • Per-shard setup time reduced 44%

Sources

← All posts