Optimize CI workflow parallelization and reduce PR overhead#6270
Merged
Optimize CI workflow parallelization and reduce PR overhead#6270
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize CI workflow parallelization and reduce PR overhead
Optimize CI workflow parallelization and reduce PR overhead
Dec 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduces CI runtime by ~40-50% on PRs and ~25-30% on main by parallelizing independent jobs and limiting expensive scans to main branch.
Changes
Job parallelization - Remove test bottleneck:
integration,security,logs-token-check,security-scan:needs: [test]→needs: [lint]Conditional execution - Skip on PRs:
bench: Main-only (performance tracking, not PR validation)fuzz: Main-only (10s provides minimal value, extended fuzzing needs hours)security-scan: Main-only (zizmor/actionlint/poutine matrix - 3 jobs)Impact
PRs: 5 fewer jobs, ~3-4min faster
Main: All jobs run, ~2-3min faster via parallelization
PRs retain full correctness coverage (unit + 6 integration groups + build + lint + js).
Original prompt
This section details on the original issue you should resolve
<issue_title>[ci-coach] Optimize CI workflow parallelization and reduce PR overhead</issue_title>
<issue_description>## CI Optimization Proposal
This PR implements high-impact optimizations to reduce CI run time by 40-50% on PRs and 25-30% on main branch pushes, based on analysis of the last 100 workflow runs.
Analysis Summary
Current State (last 100 runs):
Optimizations Implemented
1. Remove Test Job Dependency Bottleneck
Type: Job Parallelization
Impact: ~2-3 minutes per run (33% reduction in critical path)
Risk: LOW
Changes:
integration:needs: [test]→needs: [lint]security:needs: [test]→needs: [lint]logs-token-check:needs: [test]→needs: [lint]Current Job Flow:
Optimized Job Flow:
Rationale: Integration tests, security regression tests, and logs token checks don't consume any outputs from unit tests. They only need the codebase to pass linting. Running them in parallel with unit tests eliminates a major bottleneck.
Safety: These are independent test suites with no shared artifacts or dependencies beyond the source code.
2. Conditional Benchmark Execution
Type: Selective Testing
Impact: Eliminates 1 job from PRs
Risk: LOW
Changes:
bench: Addedif: github.ref == 'refs/heads/main'Rationale: Benchmarks are for performance trend tracking, not PR validation. Running them only on main branch provides the historical data needed while reducing PR overhead.
Safety: PRs still get comprehensive correctness testing (unit + integration + build + lint + js). Performance tracking on main is sufficient.
3. Conditional Fuzz Testing
Type: Selective Testing
Impact: Eliminates 1 job from PRs
Risk: LOW
Changes:
fuzz: Addedif: github.ref == 'refs/heads/main'Rationale: Fuzz testing runs for only 10 seconds per target on PRs, which provides minimal coverage. Effective fuzz testing requires hours or days. Running extended fuzzing only on main branch is more valuable than token 10s runs on every PR.
Safety: PRs still have extensive test coverage. Focused fuzzing on main provides better security validation than brief PR runs.
4. Conditional Security Scans
Type: Selective Testing
Impact: Eliminates 3 matrix jobs (zizmor, actionlint, poutine) from PRs
Risk: LOW
Changes:
security-scan:needs: [test]→needs: [lint]security-scan: Addedif: github.ref == 'refs/heads/main'Rationale: Security scans (zizmor, actionlint, poutine) are expensive checks that rarely find issues in most PRs. These are monitoring/analysis tools best suited for main branch validation.
Safety: PRs still get comprehensive testing. Security regression tests still run. Full security scanning on main ensures the baseline remains secure.
Expected Impact
For Pull Requests:
For Main Branch:
Validation
✅ YAML syntax: Manually verified, all changes follow GitHub Actions syntax
✅ Job dependencies: Reviewed to ensure no artifact dependencies broken
✅ Risk assessment: All changes are LOW risk with high impact
Testing Plan
After merge:
Future Optimization Opportunities
Based on this analysis, additional improvements for future consideration:
Rebalance integration test matrix: The "Workflow" test group likely runs more tests than the specific CLI groups (no pattern filter). Could split into more balanced groups.
Path-based test filtering: Skip tests for unrelated file changes (e.g., skip integration tests for documentation-only changes).
Unit test splitting: If unit tests grow beyond 3 minutes, consider splitti...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.