Fix: Prevent cancelled jobs from appearing as failures in CI#137
Fix: Prevent cancelled jobs from appearing as failures in CI#137
Conversation
- configure outputs separate ubuntu-os/swift/type arrays (matching MonthBar pattern) - build-ubuntu composes matrix from all three outputs; wasm/wasm-embedded types use swift:6.3-noble container; type and wasmtime-version: 41.0.3 passed to swift-build - Remove separate build-wasm job - Android: add swift 6.3 alongside 6.2, add free-disk-space step, android-swift-version/android-api-level/android-run-tests parameters, coverage upload Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix Windows matrix to use proper cross-product (runs-on × swift) instead of mismatched include entries - Fix lint/docs if conditions to guard against null head_commit on PR events - Fix cache cleanup to skip tag deletions (only process branch deletes) - Add cancellation guard to build-macos-full - Remove hardcoded swift:6.3-noble container for WASM builds; use matrix version - Add paths-ignore to CodeQL to skip doc-only commits Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
swift-docc-plugin 1.4.6 is incompatible with Swift 6.1 on Windows (missing Lock, SnippetExtractor, ParsedSymbolGraphArguments types). Windows matrix now covers 6.2 and 6.3 only. WASM/wasm-embedded tooling does not support Swift 6.0 or 6.1 on Ubuntu, so those combinations are excluded from the build matrix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ilures Cancelled jobs from concurrent workflow runs show as red failures in PR checks. The all-done job depends on lint and docs (which aggregate all build jobs), runs with if: always(), and only fails on real failures — not cancellations or skips. Configure branch protection to require All Done as the single required check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis pull request refactors SyntaxKit's architecture by introducing new Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SyntaxParser
participant SwiftSyntax as SwiftParser/SwiftSyntax
participant TokenVisitor
participant TreeNode
participant JSONEncoder
Client->>SyntaxParser: parse(code: String)
SyntaxParser->>SwiftSyntax: SwiftParser.parse(source:)
SwiftSyntax-->>SyntaxParser: SourceFileSyntax AST
SyntaxParser->>TokenVisitor: TreeNodeProtocol.parseTree(from:)
TokenVisitor->>TokenVisitor: Create SourceLocationConverter
TokenVisitor->>TokenVisitor: Instantiate TokenVisitor<TreeNode>
TokenVisitor->>SwiftSyntax: rewrite(syntax) via SyntaxRewriter
loop for each Syntax node
SwiftSyntax->>TokenVisitor: visitPre(node)
TokenVisitor->>TreeNode: Create NodeType instance
TokenVisitor->>TokenVisitor: appendStructure(from:allChildren:)
TokenVisitor->>TokenVisitor: Link parent/child relationships
SwiftSyntax->>TokenVisitor: visit(token) for leaf nodes
TokenVisitor->>TreeNode: Store token kind + trivia
SwiftSyntax->>TokenVisitor: visitPost(node)
TokenVisitor->>TokenVisitor: Restore parent context
end
TokenVisitor-->>SyntaxParser: [TreeNode] array
SyntaxParser->>JSONEncoder: encode([TreeNode])
JSONEncoder-->>Client: [TreeNode] (or deprecated JSON)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v0.0.4 #137 +/- ##
==========================================
+ Coverage 77.87% 78.11% +0.24%
==========================================
Files 126 126
Lines 4555 4555
==========================================
+ Hits 3547 3558 +11
+ Misses 1008 997 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Review: Fix: Prevent cancelled jobs from appearing as failures in CIThe core change — the Critical: Build failures silently bypass the aggregatorFile: If any build job (e.g. if: ${{ !cancelled() && !failure() && ... }}When Fix option A — have all-done:
if: always()
needs: [lint, docs, build-ubuntu, build-macos, build-macos-full, build-windows, build-android]Fix option B — treat skipped lint/docs as a signal of upstream failure: - name: Check for failures
run: |
lint_result="${{ needs.lint.result }}"
docs_result="${{ needs.docs.result }}"
failures="${{ contains(needs.*.result, 'failure') }}"
if [[ "$failures" == "true" ]]; then
echo "One or more required jobs failed."
exit 1
fi
if [[ "$lint_result" == "skipped" || "$docs_result" == "skipped" ]]; then
echo "lint or docs were skipped, likely due to an upstream build failure."
exit 1
fiOption A is simpler and more robust — it covers any future jobs added to Minor: Shell expression interpolation styleThe - name: Fail on job failures
if: contains(needs.*.result, 'failure')
run: |
echo "One or more required jobs failed."
exit 1
- name: All checks passed
run: echo "All required checks passed, were skipped, or were cancelled."cleanup-caches.yml — looks goodThe cleanup-pr-caches.yml — looks goodTriggered on codeql.yml — looks goodThe Summary
The |
Code ReviewSummaryTheall-done aggregator pattern is the right approach for making required status checks work correctly with matrix/conditional jobs. A few things to consider.Issues1. The PR description says this fixes cancelled jobs appearing as failures, but the aggregator only monitors 2. All-cancelled scenario passes silently The current check only fails on 3. Branch protection rules not updated This job works as a required check only if All Done is added as a required status check in the GitHub repo branch protection settings. That is a manual step outside this PR — worth noting in the PR description or follow-up so it does not get forgotten. Positives
|
PR Review: Fix: Prevent cancelled jobs from appearing as failures in CIThe approach is sound - an aggregator job with Issue: Incomplete
|
Code Review: Prevent cancelled jobs from appearing as CI failuresClear intent, well-known pattern. A few notes: Positives
Concerns
Summary: Pattern is sound. The main question is whether all-cancelled-passes is acceptable for branch protection policy here. |
Code ReviewSummary: Adds an all-done aggregator job so that cancelled jobs do not surface as failures in PR checks. This is a well-known pattern for GitHub Actions and the implementation is correct. What looks good:
One question worth confirming: The aggregator depends on Verdict: Looks correct and addresses the false-failure problem cleanly. No changes needed. |
|
PR 137 Code Review - Fix: Prevent cancelled jobs from appearing as failures in CI The implementation follows the standard pattern for this problem and is correct for the stated goal. Logic analysis
Minor gap: all-skipped case If both lint and docs are skipped due to event filtering, all-done will succeed with no jobs having actually run. A stricter check would also verify Important follow-up action The fix is only effective if All Done is configured as the sole required status check in branch protection. Without that, individual cancelled job statuses will still be evaluated. Consider adding a comment in the workflow documenting this requirement so future maintainers understand why the aggregator exists. No test changes needed - purely CI configuration. |
Summary
Test plan
🤖 Generated with Claude Code
Perform an AI-assisted review on
Summary by CodeRabbit
New Features
Chores
Tests