feat(ci): Implement aggregate job pattern for path-based CI checks#82
Merged
Conversation
Replaces path-filtered workflow triggers with conditional jobs and an aggregate status check to solve the branch protection blocking issue. **Problem:** - Path filters at workflow level cause checks to not run for docs-only commits - Branch protection requires these checks - Checks stuck in "Pending" state forever - Blocks appcast workflow from pushing to Docs/ **Solution:** - Remove paths from workflow trigger (workflow always runs) - Add "changes" detection job using dorny/paths-filter - Make build/test/lint/format conditional on code changes - Add "all-clear" aggregate job that always runs - Jobs that skip report "Success" (not "Pending") **How It Works:** 1. Docs-only commit → changes detects no code changes 2. Build/test/lint/format jobs skip (report Success) 3. all-clear job checks results, sees no failures, passes ✅ 4. Push succeeds without running full CI **Branch Protection Setup:** - Require ONLY the "All Clear" check - Do NOT require individual Build/Test/Lint/Format checks - This single check aggregates all results **Benefits:** - Appcast workflow can push docs without CI - Code changes still require full CI validation - No false "Pending" blocks - Battle-tested pattern used by major teams Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Implements the aggregate job pattern to enable path-based CI checking without blocking automation. This solves the critical issue where the appcast workflow cannot push documentation updates to
main.The Problem We're Solving
Current Issue:
When the appcast workflow pushes
Docs/appcast.xmlupdates:paths:filters (only runs on code changes)Why GitHub Rulesets Didn't Work:
After extensive research, we discovered:
Sources/**means "branches starting with Sources/" (likeSources/feature-foo)The Solution: Aggregate Job Pattern
This is the battle-tested, industry-standard pattern for monorepos and path-filtered CI.
How It Works
Before (Blocked):
→ Docs commit → Workflow skipped → Checks "Pending" → Blocked
After (Fixed):
→ Docs commit → changes detects no code → Jobs skip (report Success) → all-clear passes ✅
Key Technical Details
Skipped jobs report "Success" - When a job has
if: conditionthat evaluates false, GitHub treats it as succeeded, NOT pendingall-clear always runs - Uses
if: always()to run regardless of upstream job resultsChecks for failures - Uses
contains(needs.*.result, 'failure')to detect if any required job failedOne required check - Branch protection only needs to require "All Clear", not individual jobs
Changes
Modified:
.github/workflows/ci.ymlRemoved:
paths:filters from workflow triggers (lines 6-14, 17-25)Added:
changesjob - Detects file changes usingdorny/paths-filter@v3build,test,lint,formatjobsall-clearaggregate job with failure detectionUnchanged:
build-releasejob unchangedImpact
Immediate Benefits
Docs/without CI blocksWhat Still Works
Testing This PR
This PR will demonstrate the fix:
.github/workflows/ci.yml(workflow file)After merge, test with docs-only commit:
Should succeed without running full CI.
Branch Protection Setup (After Merge)
Create one simple ruleset or use legacy branch protection:
GitHub Rulesets (Recommended):
OR Legacy Branch Protection:
mainCRITICAL: Do NOT require Build/Test/Lint/Format individually - only require "All Clear"
References
This pattern is widely documented and used by major engineering teams:
Rollback Plan
If issues arise:
🤖 Generated with Claude Code