Skip to content

ci: allow Swift SDK build to run when Rust tests are skipped#3351

Merged
QuantumExplorer merged 1 commit into
v3.1-devfrom
ci/swift-build-skip-fix
Mar 16, 2026
Merged

ci: allow Swift SDK build to run when Rust tests are skipped#3351
QuantumExplorer merged 1 commit into
v3.1-devfrom
ci/swift-build-skip-fix

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

@QuantumExplorer QuantumExplorer commented Mar 16, 2026

Summary

  • Fix Swift SDK build job being skipped when PRs only change Swift files (no Rust changes)

Details

The swift-sdk-build job depends on rs-workspace-tests. When a PR only changes Swift files, rs-workspace-tests skips (no Rust changes detected). GitHub Actions propagates the skip to all downstream needs jobs, so Swift build never runs — even though swift-sdk-changed is true.

Before: Swift-only PRs like #3079 skip the Swift build entirely
After: Swift build runs when Rust tests skip or pass, blocks only on Rust test failure

The fix uses always() with explicit failure guards:

if: >-
  always()
  && needs.changes.outputs.swift-sdk-changed == 'true'
  && needs.changes.result != 'failure'
  && needs.rs-workspace-tests.result != 'failure'

Test plan

  • Verify Swift-only PR triggers Swift SDK build
  • Verify Rust+Swift PR still runs both jobs in order
  • Verify Rust test failure still blocks Swift build

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced test workflow gating conditions to improve build reliability. Updated logic to prevent unnecessary Swift SDK builds from executing when prior validation steps fail, resulting in more efficient pipeline execution.

The swift-sdk-build job depends on rs-workspace-tests, but when a PR
only changes Swift files (no Rust changes), rs-workspace-tests skips
entirely. GitHub Actions propagates the skip to all downstream jobs,
so the Swift build never runs even though swift-sdk-changed is true.

Fix: use always() with explicit failure checks so the Swift build
runs when Rust tests skip (Swift-only PRs) or pass, but still blocks
when Rust tests fail or change detection fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v3.1.0 milestone Mar 16, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

Updated the Swift SDK build workflow condition to include multiple guards: always evaluation, verification that Swift SDK files changed, and checks ensuring prior job steps did not fail. This prevents unnecessary builds while preserving existing triggers.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/tests.yml
Expanded the gating condition for Swift SDK build to evaluate always(), check swift-sdk-changed == true, and verify prior job results are not failure states, preventing builds when upstream steps fail.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A workflow refined, so precise,
Guards in place, conditions now nice,
Swift SDK flows when the time is right,
No false alarms in the night!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating the Swift SDK build condition to run when Rust tests are skipped, which is the core problem being solved.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/swift-build-skip-fix
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.66%. Comparing base (17a6fe9) to head (55dba26).
⚠️ Report is 1 commits behind head on v3.1-dev.

Additional details and impacted files
@@            Coverage Diff            @@
##           v3.1-dev    #3351   +/-   ##
=========================================
  Coverage     75.66%   75.66%           
=========================================
  Files          3000     3000           
  Lines        275571   275571           
=========================================
+ Hits         208501   208509    +8     
+ Misses        67070    67062    -8     
Components Coverage Δ
dpp 62.75% <ø> (ø)
drive 81.37% <ø> (ø)
drive-abci 85.99% <ø> (ø)
sdk 31.25% <ø> (ø)
dapi-client 79.06% <ø> (ø)
platform-version ∅ <ø> (∅)
platform-value 58.46% <ø> (ø)
platform-wallet 60.40% <ø> (ø)
drive-proof-verifier ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)

204-204: Tighten upstream result checks to avoid running after cancellations.

On line 204, the condition uses != 'failure', which allows jobs with cancelled status to pass. If rs-workspace-tests is cancelled, swift-sdk-build can still run. Use explicit allowlisting of expected states instead.

Proposed condition update
-    if: ${{ always() && needs.changes.outputs.swift-sdk-changed == 'true' && needs.changes.result != 'failure' && needs.rs-workspace-tests.result != 'failure' }}
+    if: ${{ always() && needs.changes.outputs.swift-sdk-changed == 'true' && needs.changes.result == 'success' && (needs.rs-workspace-tests.result == 'success' || needs.rs-workspace-tests.result == 'skipped') }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/tests.yml at line 204, The if expression currently uses
"!= 'failure'" which lets cancelled upstream jobs pass; update the condition so
both needs.changes.result and needs.rs-workspace-tests.result are explicit
allowlisted states (e.g., change "needs.changes.result != 'failure'" and
"needs.rs-workspace-tests.result != 'failure'" to "needs.changes.result ==
'success'" and "needs.rs-workspace-tests.result == 'success'") so
swift-sdk-build only runs when the upstream jobs succeeded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/tests.yml:
- Line 204: The if expression currently uses "!= 'failure'" which lets cancelled
upstream jobs pass; update the condition so both needs.changes.result and
needs.rs-workspace-tests.result are explicit allowlisted states (e.g., change
"needs.changes.result != 'failure'" and "needs.rs-workspace-tests.result !=
'failure'" to "needs.changes.result == 'success'" and
"needs.rs-workspace-tests.result == 'success'") so swift-sdk-build only runs
when the upstream jobs succeeded.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f9c6254-b528-4ecf-b901-9f33c0448e29

📥 Commits

Reviewing files that changed from the base of the PR and between 17a6fe9 and 55dba26.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

@QuantumExplorer QuantumExplorer merged commit 331ca00 into v3.1-dev Mar 16, 2026
22 checks passed
@QuantumExplorer QuantumExplorer deleted the ci/swift-build-skip-fix branch March 16, 2026 16:35
QuantumExplorer added a commit that referenced this pull request Mar 17, 2026
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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