Skip to content

ci: optimize PR pipeline — concurrency, fast gate, reduced matrix#215

Merged
RtlZeroMemory merged 1 commit intomainfrom
ci/optimize-pr-pipeline
Feb 26, 2026
Merged

ci: optimize PR pipeline — concurrency, fast gate, reduced matrix#215
RtlZeroMemory merged 1 commit intomainfrom
ci/optimize-pr-pipeline

Conversation

@RtlZeroMemory
Copy link
Owner

@RtlZeroMemory RtlZeroMemory commented Feb 26, 2026

Summary

  • Concurrency groups on ci.yml and codeql.yml — cancel in-progress runs when a new push arrives on the same PR, freeing runners immediately
  • Fast checks gate — lint, typecheck, codegen, portability, and unicode checks run once on Linux/Node 22 (~2 min); failures prevent the expensive matrix from starting at all
  • Dynamic matrix — PRs use 5 runners (Linux × Node 18/20/22, macOS × 22, Windows × 22); push to main keeps the full 3×3 = 9
  • Removed redundant work — lint/typecheck/codegen/biome-install stripped from each matrix cell and the bun job; duplicate docs job removed (already in docs.yml)

Before vs After (PR)

Metric Before After
Matrix runners 9 5
Total jobs 13 9
Time to lint failure ~3–5 min ~2 min
Redundant lint/typecheck runs 9 0
Cancel on re-push No Yes

Full 3×3 matrix still runs on push to main — no safety regression.

Test plan

  • Verify CI passes on this PR (the new pipeline tests itself)
  • Force-push to confirm stale run is cancelled
  • Confirm docs required status check doesn't reference the removed ci.yml job (if applicable in branch protection)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Optimized CI/CD pipeline with concurrency controls to prevent duplicate workflow runs
    • Enhanced workflow efficiency through improved job organization and platform-specific optimizations

- Add concurrency group to ci.yml and codeql.yml to cancel in-progress
  runs on re-push (biggest win for runner contention)
- Extract lint/typecheck/codegen/portability/unicode into a dedicated
  `checks` job that gates the matrix — lint failures caught in ~2 min
  instead of after the full 15-min pipeline
- Dynamic matrix: 5 runners on PRs (Linux × Node 18/20/22, macOS × 22,
  Windows × 22), full 3×3 on push to main
- Remove redundant lint/typecheck/codegen/biome-install steps from each
  matrix cell and the bun job
- Remove duplicate docs job (already handled by docs.yml)

Net effect on PRs: 13 jobs → 9, ~44% fewer runners, fast-fail on
static checks, stale runs cancelled automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fdcbb0 and 945caa0.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml

📝 Walkthrough

Walkthrough

The CI workflow is refactored to introduce concurrency controls, extract fast platform-independent checks into a dedicated job, and compute test matrices dynamically based on event type. The CodeQL workflow gains concurrency configuration to cancel redundant PR runs.

Changes

Cohort / File(s) Summary
CI Workflow Restructuring
.github/workflows/ci.yml
Reorganized pipeline with concurrency group for PRs, new checks job (codegen, lint, typecheck, portability, Unicode validation), new matrix-config job for dynamic matrix computation, rewired ci job dependencies on matrix output, conditional Linux/non-Linux steps, and removed docs job.
CodeQL Concurrency
.github/workflows/codeql.yml
Added concurrency block with group key and pull-request-only cancellation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A rabbit hops through CI lanes,
Fast checks first, no more delays,
Dynamic matrices adapt their way,
Concurrency curbs the wasteful race,
Workflows leap with newfound grace! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/optimize-pr-pipeline

Comment @coderabbitai help to get the list of available commands and usage tips.

@RtlZeroMemory RtlZeroMemory merged commit 9eb8273 into main Feb 26, 2026
21 of 22 checks passed
@RtlZeroMemory RtlZeroMemory deleted the ci/optimize-pr-pipeline branch February 28, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant