Hasty Briefsbeta

Bilingual

AI coding has made CI a bottleneck, so we reworked ours to keep up

an hour ago
  • Linear optimized its CI pipeline to keep up with accelerated AI-driven development, reducing PR wait times from over 6 minutes to just over 5 despite test suites nearly quadrupling.
  • Key improvements included upgrading to third-party runners with faster CPUs and storage, and switching to the native TypeScript compiler tsgo, which cut typechecking time by 73%.
  • Lint rules were rewritten from type-dependent to static analysis, reducing lint time by up to 68% and memory usage, and facilitating a move to Oxlint.
  • Critical path optimization involved reducing checkout depth, using sparse blobless checkouts, adding retry logic for network resilience, and moving non-essential cache writes out of the gating path, saving about a minute per PR.
  • Setup costs were cut by using a pre-built CI base image, filtering pnpm installs to only necessary packages, and avoiding caching when rebuilding was faster, reducing per-shard setup time by 44%.
  • Test execution became more efficient by splitting large test files, increasing shards from four to eight, and using non-isolated Vitest projects where safe, cutting the slowest shard time from 5.25 to 4.33 minutes.
  • The combination of these changes means today's larger test suite would take about 11 minutes without improvements, but now takes just over 5, with ongoing efforts to manage growing codebase.
  • Monthly runner time savings include consolidating short checks, saving roughly 87,000 runner-minutes (11.8% of total CI usage), and the non-isolated test project saving about 17%.
  • Future plans involve continuously addressing new bottlenecks as the codebase grows, with around 2,000 tests added weekly.