Reduce PR check wall time #355

Closed
opened 2026-04-12 08:19:03 -07:00 by jwilger-ai-bot · 0 comments
jwilger-ai-bot commented 2026-04-12 08:19:03 -07:00 (Migrated from github.com)

Summary

PR checks take too long and cause unnecessary delays in iteration and delivery. This issue covers all approaches to reducing PR check wall time.

Problem

The current CI pipeline runs every job on every PR regardless of what changed, and jobs that could run in parallel may not be optimally parallelized. This creates unnecessary wait times that slow down the development feedback loop.

Approaches

1. Skip irrelevant jobs based on changed file paths

Add a path-filtering mechanism so jobs only run when relevant files change:

  • Path-based if conditions on existing jobs (e.g., skip Rust jobs when only *.md, .claude/rules/**, docs/** change). The if condition must prevent the job from starting at all — no container spin-up, no checkout, no wasted runner time.
  • A new "gate" job that checks whether all required jobs succeeded, accounting for intentional skips. This gate job is the only job required by branch protection.

Jobs that should be skippable for non-code PRs:

  • Rust build
  • Rust test (nextest)
  • Clippy lint
  • Mutation testing (cargo mutants)
  • Any other Rust-specific jobs

2. Move CodeQL to scheduled-only

Move CodeQL analysis out of PR triggers. It should only run:

  • On pushes to main
  • On a cron schedule (e.g., weekly)

Remove CodeQL from branch protection required checks.

3. Other optimizations to investigate

Any additional improvements that reduce wall time for PRs that do need Rust checks:

  • Cargo build caching (sccache, GitHub Actions cache)
  • Job parallelization (are jobs that could run concurrently waiting on each other?)
  • Splitting the test suite across parallel runners
  • Incremental compilation / workspace-aware test selection
  • Reducing mutation testing scope to changed crates only

Acceptance Criteria

  • Documentation-only PRs (*.md, docs/**) skip all Rust jobs including mutation testing
  • Rule/config-only PRs (.claude/rules/**, REVIEW.md, CLAUDE.md) skip all Rust jobs
  • Skipped jobs do not spin up containers or runners — skip happens at the job if level
  • Skipped jobs are treated as successful for merge purposes
  • A single required status check (gate job) determines PR mergeability
  • PRs that touch Rust code still run the full CI matrix
  • Mixed PRs (code + docs) run the full matrix
  • CodeQL checks removed from PR triggers
  • CodeQL runs on main pushes and on a weekly schedule only
  • CodeQL removed from branch protection required checks
  • Wall time for code-touching PRs is measured before and after, with improvement documented
## Summary PR checks take too long and cause unnecessary delays in iteration and delivery. This issue covers all approaches to reducing PR check wall time. ## Problem The current CI pipeline runs every job on every PR regardless of what changed, and jobs that could run in parallel may not be optimally parallelized. This creates unnecessary wait times that slow down the development feedback loop. ## Approaches ### 1. Skip irrelevant jobs based on changed file paths Add a path-filtering mechanism so jobs only run when relevant files change: - **Path-based `if` conditions** on existing jobs (e.g., skip Rust jobs when only `*.md`, `.claude/rules/**`, `docs/**` change). The `if` condition must prevent the job from starting at all — no container spin-up, no checkout, no wasted runner time. - **A new "gate" job** that checks whether all *required* jobs succeeded, accounting for intentional skips. This gate job is the only job required by branch protection. Jobs that should be skippable for non-code PRs: - Rust build - Rust test (nextest) - Clippy lint - Mutation testing (`cargo mutants`) - Any other Rust-specific jobs ### 2. Move CodeQL to scheduled-only Move CodeQL analysis out of PR triggers. It should only run: - On pushes to `main` - On a cron schedule (e.g., weekly) Remove CodeQL from branch protection required checks. ### 3. Other optimizations to investigate Any additional improvements that reduce wall time for PRs that *do* need Rust checks: - Cargo build caching (sccache, GitHub Actions cache) - Job parallelization (are jobs that could run concurrently waiting on each other?) - Splitting the test suite across parallel runners - Incremental compilation / workspace-aware test selection - Reducing mutation testing scope to changed crates only ## Acceptance Criteria - [ ] Documentation-only PRs (`*.md`, `docs/**`) skip all Rust jobs including mutation testing - [ ] Rule/config-only PRs (`.claude/rules/**`, `REVIEW.md`, `CLAUDE.md`) skip all Rust jobs - [ ] Skipped jobs do not spin up containers or runners — skip happens at the job `if` level - [ ] Skipped jobs are treated as successful for merge purposes - [ ] A single required status check (gate job) determines PR mergeability - [ ] PRs that touch Rust code still run the full CI matrix - [ ] Mixed PRs (code + docs) run the full matrix - [ ] CodeQL checks removed from PR triggers - [ ] CodeQL runs on `main` pushes and on a weekly schedule only - [ ] CodeQL removed from branch protection required checks - [ ] Wall time for code-touching PRs is measured before and after, with improvement documented
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jwilger/eventcore#355
No description provided.