Skip to content

ci: schedule Rust workspace tests on macOS or Linux self-hosted runners - #4287

Merged
QuantumExplorer merged 2 commits into
v4.2-devfrom
claude/rust-tests-linux-macos-4ab08f
Aug 5, 2026
Merged

ci: schedule Rust workspace tests on macOS or Linux self-hosted runners#4287
QuantumExplorer merged 2 commits into
v4.2-devfrom
claude/rust-tests-linux-macos-4ab08f

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Aug 4, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

We added a self-hosted Linux runner, but Rust workspace tests / Tests (macOS) was pinned to runs-on: [self-hosted, macOS, ARM64] and could never schedule onto it. Labels in a runs-on array are AND-ed — there is no OR syntax — so no edit to that list alone can express "macOS or Linux".

Current runners on this repo:

runner labels
mac-runner-1, mac-runner-2 self-hosted, macOS, ARM64
ubuntu-runner-1 self-hosted, Linux, X64, ubuntu, ms-a2

What was done?

Select on a shared custom label instead:

runs-on: [self-hosted, rust-ci]

Whichever of the three runners is idle takes the job. Keeping self-hosted in the list means a GitHub-hosted Linux VM can never match it, so Linux stays self-hosted-only.

Making the job body portable:

  • Build deps — the Homebrew step is gated to macOS. Linux gets an apt equivalent covering only what ./.github/actions/rust doesn't already install (it handles clang, llvm and libsnappy on Linux), plus gh for the immutable-structure check and rustup for dtolnay/rust-toolchain. Each branch is guarded, so it's a no-op once the persistent runner is provisioned by the first run.
  • Disk prune — the absolute 120 GB / 60 GB-free caps are now clamped to a share of the volume (TOTAL/3 and TOTAL/5). On the large macOS volumes this is exactly today's behavior; it stops a smaller volume from tripping the floor on every run and forcing a cold rebuild each time.
  • GPG reset — a macOS keyboxd workaround, gated to macOS.

Linux builds rocksdb from source the same way macOS already does, rather than linking the prebuilt static lib the old Ubuntu jobs used. The persistent target/ makes that a one-time cost and it avoids their sed pass rewriting cdylib crate-types in Cargo.toml, which static rocksdb forced.

Removed the three Ubuntu backup jobs (test-ubuntu, lint-ubuntu, and the whole of tests-rs-doctests.yml) along with their sleep 15 + poll-the-Mac-job-status dance. UBUNTU_BACKUP_ENABLED is false on this repo, so they have been dead code; a second self-hosted runner is the redundancy they were standing in for. Doctests already run inside both Rust jobs under doctests-changed, so dropping the standalone rs-doctests job loses no coverage.

Also added .github/actionlint.yaml declaring rust-ci, so local actionlint runs don't flag it as an unknown label.

Required before merge

The rust-ci label must be added to all three runners (Settings → Actions → Runners → runner → Labels). Until then the job has nothing to schedule onto and will sit queued.

How Has This Been Tested?

  • actionlint (with shellcheck) clean across the three touched workflows; the remaining shellcheck notes are pre-existing and unrelated — the same SC2086 fires on the untouched Homebrew line in tests-rs-wallet.yml.
  • YAML parse + job-list check on all three files.
  • Swept for stale references to the deleted workflow, the old Tests (macOS) job name, and UBUNTU_BACKUP_ENABLED; the three comment mentions left behind were updated.
  • Branch protection on v4.2-dev has no required status checks configured, so the job rename breaks no gate.
  • CI on this PR is the real test of the Linux path — it can't be exercised locally.

Breaking Changes

None.

Notes for reviewers

  • tests-rs-wallet.yml stays pinned to the macOS runners. That fast path is short and mac-only by design; floating it too is a reasonable follow-up but I kept this PR to the workspace job. Its header comment is updated to say so.
  • UBUNTU_BACKUP_ENABLED is now unreferenced and can be deleted from repo variables.
  • Fork PRs get no Rust coverage — unchanged. The if: guard blocked them from the mac runners before and now guards both platforms; the Ubuntu backup that could theoretically have covered them was disabled.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked there is no other PR doing the same thing

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated CI configuration to support self-hosted runners labeled rust-ci.
    • Consolidated Rust workspace testing onto self-hosted runners with automatic environment setup and disk-capacity checks.
    • Removed the standalone Rust doctest workflow and Ubuntu fallback jobs.
    • Updated wallet workflow documentation to reflect revised macOS runner requirements and testing scope.
    • Improved workflow safeguards for fork-based pull requests and runner environments.

`runs-on` label arrays are AND-ed, so `[self-hosted, macOS, ARM64]` could
never also match the new Linux runner. Select on a shared custom label
instead: `[self-hosted, rust-ci]`, applied to both mac runners and the
Linux one. Keeping `self-hosted` in the list means GitHub-hosted runners
still can't pick the job up.

Making the job portable:

- Homebrew setup is gated to macOS; Linux gets an apt equivalent for what
  ./.github/actions/rust doesn't already install (it handles clang, llvm
  and libsnappy), plus gh for the immutable-structure check and rustup for
  dtolnay/rust-toolchain. Every branch is a no-op after the first run.
- The disk prune clamps its absolute caps to a share of the volume, so a
  smaller runner doesn't purge target/ on every run and cold-rebuild.
- The GPG keyboxd reset is a macOS runner workaround, so it's gated too.

Linux builds rocksdb from source like macOS does rather than linking the
prebuilt static lib the old Ubuntu jobs used. The persistent target/ makes
that a one-time cost, and it avoids their sed pass over Cargo.toml crate
types, which static rocksdb forced.

The three Ubuntu backup jobs and their poll-the-Mac-job dance are removed.
UBUNTU_BACKUP_ENABLED has been false, so they were dead code, and a second
self-hosted runner is the redundancy they were standing in for. That
empties tests-rs-doctests.yml; doctests already run inside both Rust jobs
under `doctests-changed`.

The job is renamed Tests (macOS) -> Tests. No branch protection rule
references it. Requires the `rust-ci` label on all three runners.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f60eb232-d2ba-45e8-bb82-d7475f01fe47

📥 Commits

Reviewing files that changed from the base of the PR and between 0444662 and 32f8afc.

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

📝 Walkthrough

Walkthrough

Rust CI now runs through self-hosted rust-ci runners. The workflow provisions Linux tools, adjusts disk and GPG cleanup, removes the standalone doctest path, and updates fork-execution documentation.

Changes

Rust CI workflow migration

Layer / File(s) Summary
Self-hosted runner selection and execution scope
.github/actionlint.yaml, .github/workflows/tests-rs-workspace.yml, .github/workflows/tests.yml, .github/workflows/tests-rs-wallet.yml
The workspace test job uses the [self-hosted, rust-ci] labels. Comments document fork handling and macOS runner requirements.
Runner provisioning and disk management
.github/workflows/tests-rs-workspace.yml
The workflow provisions Linux dependencies, GitHub CLI, and Rustup when needed. Disk thresholds use volume capacity. GPG cleanup runs only on macOS.
Doctest workflow removal
.github/workflows/tests.yml, .github/workflows/tests-rs-doctests.yml, .github/workflows/tests-rs-wallet.yml
The standalone Rust doctest workflow and its dispatch path are removed. Wallet comments no longer reference the Ubuntu fallback job.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: running Rust workspace tests on macOS or Linux self-hosted runners.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/rust-tests-linux-macos-4ab08f

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.

@github-actions github-actions Bot added this to the v4.2.0 milestone Aug 4, 2026
@thepastaclaw

thepastaclaw commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

⛔ Blockers found — Sonnet deferred (commit 0444662)
Canonical validated blockers: 2

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/tests.yml:
- Around line 157-162: Update the workflow scope comment near the fork pull
request handling to say that untrusted fork PRs must use the full workspace
path, while acknowledging the trusted thepastaclaw fork exception that may use
the wallet scope and reach tests-rs-wallet.yml. Preserve the existing
distinctions for same-repository pull requests, push runs, and scheduled runs.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 44d48aaf-5c35-4c0a-8958-6b21dcabd387

📥 Commits

Reviewing files that changed from the base of the PR and between 746b34d and 0444662.

📒 Files selected for processing (5)
  • .github/actionlint.yaml
  • .github/workflows/tests-rs-doctests.yml
  • .github/workflows/tests-rs-wallet.yml
  • .github/workflows/tests-rs-workspace.yml
  • .github/workflows/tests.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/tests-rs-doctests.yml

Comment on lines 157 to +162
# The fast path applies only to same-repo pull requests. Fork PRs
# must take the full workspace path (whose Ubuntu backup jobs cover
# them when UBUNTU_BACKUP_ENABLED is set, while the wallet
# workflow's only job skips fork PRs). Push and schedule runs have
# no reliable base SHA — scope computed from the last commit alone
# could silently downgrade the nightly / post-merge full runs.
# must take the full workspace path (both Rust workflows skip fork
# PRs outright, since neither may run untrusted code on a persistent
# runner). Push and schedule runs have no reliable base SHA — scope
# computed from the last commit alone could silently downgrade the
# nightly / post-merge full runs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Describe the trusted fork exception in the scope comment.

The comment says that fork pull requests use the full workspace path. Lines [168]-[170] treat a fork owned by thepastaclaw as trusted, so that fork may use scope=wallet and reach tests-rs-wallet.yml. Change the comment to say Untrusted fork PRs.

Proposed wording
-          # The fast path applies only to same-repo pull requests. Fork PRs
-          # must take the full workspace path (both Rust workflows skip fork
-          # PRs outright, since neither may run untrusted code on a persistent
-          # runner). Push and schedule runs have no reliable base SHA — scope
+          # The fast path applies only to same-repo pull requests. Untrusted
+          # fork PRs are classified as full-scope changes. Both Rust workflows
+          # skip those PRs, since neither may run untrusted code on a
+          # persistent runner. Push and schedule runs have no reliable base SHA
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# The fast path applies only to same-repo pull requests. Fork PRs
# must take the full workspace path (whose Ubuntu backup jobs cover
# them when UBUNTU_BACKUP_ENABLED is set, while the wallet
# workflow's only job skips fork PRs). Push and schedule runs have
# no reliable base SHA — scope computed from the last commit alone
# could silently downgrade the nightly / post-merge full runs.
# must take the full workspace path (both Rust workflows skip fork
# PRs outright, since neither may run untrusted code on a persistent
# runner). Push and schedule runs have no reliable base SHA — scope
# computed from the last commit alone could silently downgrade the
# nightly / post-merge full runs.
# The fast path applies only to same-repo pull requests. Untrusted
# fork PRs are classified as full-scope changes. Both Rust workflows
# skip those PRs, since neither may run untrusted code on a
# persistent runner. Push and schedule runs have no reliable base SHA
# computed from the last commit alone could silently downgrade the
# nightly / post-merge full runs.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests.yml around lines 157 - 162, Update the workflow
scope comment near the fork pull request handling to say that untrusted fork PRs
must use the full workspace path, while acknowledging the trusted thepastaclaw
fork exception that may use the wallet scope and reach tests-rs-wallet.yml.
Preserve the existing distinctions for same-repository pull requests, push runs,
and scheduled runs.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Preliminary review — Codex only

The shared runner label and OS-specific workflow gates correctly allow the workspace job to target either macOS or Linux. However, the Linux bootstrap omits both the OpenSSL development files required by the workspace dependency graph and the cargo-nextest executable required by the test command, so a newly provisioned runner cannot reliably complete the job. The Rust scope comment also inaccurately describes the explicitly trusted fork exception.

Source: reviewers codex/general=gpt-5.6-sol(completed); verifier=codex/verifier=gpt-5.6-sol(completed); coordinator=openclaw-agent/cliproxy/gpt-5.6-sol(orchestration-only).

Validated blockers were found in the Codex precheck. Sonnet is deferred until a fresh Codex revalidation clears the blocker gate.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet: not run (deferred by blocker gate)

🔴 2 blocking | 💬 1 nitpick(s)

1 additional finding(s) omitted (not in diff).

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `.github/workflows/tests-rs-workspace.yml`:
- [BLOCKING] .github/workflows/tests-rs-workspace.yml:84: Install OpenSSL headers on the Linux runner
  The Linux provisioning list installs `pkg-config` but not the OpenSSL development package. The Linux workspace build activates the default, non-vendored `openssl-sys` feature through `native-tls` and reqwest, including during `cargo clippy --workspace --all-features`. On a fresh Ubuntu runner, `openssl-sys` therefore cannot find the required OpenSSL headers and `openssl.pc` metadata. Add `libssl-dev` to the packages installed during first-run provisioning.
- [BLOCKING] .github/workflows/tests-rs-workspace.yml:118-119: Provision cargo-nextest before invoking llvm-cov nextest
  The test step runs `cargo llvm-cov nextest`, which delegates execution to the separately installed `cargo-nextest` binary. Installing `cargo-llvm-cov` does not provide that binary. The installer was previously removed from the macOS path only because nextest was already installed on those persistent runners, while the deleted Ubuntu fallback installed it explicitly. The new Linux first-run setup does neither, so a fresh Linux runner will fail when it reaches the non-shielded test step.

Comment thread .github/workflows/tests-rs-workspace.yml Outdated
Comment on lines 157 to +162
# The fast path applies only to same-repo pull requests. Fork PRs
# must take the full workspace path (whose Ubuntu backup jobs cover
# them when UBUNTU_BACKUP_ENABLED is set, while the wallet
# workflow's only job skips fork PRs). Push and schedule runs have
# no reliable base SHA — scope computed from the last commit alone
# could silently downgrade the nightly / post-merge full runs.
# must take the full workspace path (both Rust workflows skip fork
# PRs outright, since neither may run untrusted code on a persistent
# runner). Push and schedule runs have no reliable base SHA — scope
# computed from the last commit alone could silently downgrade the
# nightly / post-merge full runs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

💬 Nitpick: Document the trusted fork exception in the scope comment

The comment says the fast path applies only to same-repository pull requests and that both Rust workflows skip fork PRs, but the condition immediately below explicitly trusts forks owned by thepastaclaw. Those pull requests continue through wallet-scope classification and can reach tests-rs-wallet.yml. Update the comment to distinguish untrusted forks from this trusted exception.

Suggested change
# The fast path applies only to same-repo pull requests. Fork PRs
# must take the full workspace path (whose Ubuntu backup jobs cover
# them when UBUNTU_BACKUP_ENABLED is set, while the wallet
# workflow's only job skips fork PRs). Push and schedule runs have
# no reliable base SHA — scope computed from the last commit alone
# could silently downgrade the nightly / post-merge full runs.
# must take the full workspace path (both Rust workflows skip fork
# PRs outright, since neither may run untrusted code on a persistent
# runner). Push and schedule runs have no reliable base SHA — scope
# computed from the last commit alone could silently downgrade the
# nightly / post-merge full runs.
# The fast path applies to same-repo pull requests and to the trusted
# thepastaclaw fork. Untrusted fork PRs are classified as full-scope
# changes, and both Rust workflows skip them because neither may run
# untrusted code on a persistent runner. Push and schedule runs have
# no reliable base SHA — scope computed from the last commit alone
# could silently downgrade the nightly / post-merge full runs.

source: ['coderabbit']

Co-authored-by: Lil Claw <pasta+claw@dashboost.org>

@QuantumExplorer QuantumExplorer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reviewed

@QuantumExplorer
QuantumExplorer merged commit 163b9cd into v4.2-dev Aug 5, 2026
6 of 8 checks passed
@QuantumExplorer
QuantumExplorer deleted the claude/rust-tests-linux-macos-4ab08f branch August 5, 2026 03:52
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.57%. Comparing base (746b34d) to head (32f8afc).
⚠️ Report is 2 commits behind head on v4.2-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           v4.2-dev    #4287      +/-   ##
============================================
+ Coverage     87.54%   87.57%   +0.03%     
============================================
  Files          2679     2700      +21     
  Lines        341312   344254    +2942     
============================================
+ Hits         298798   301492    +2694     
- Misses        42514    42762     +248     
Components Coverage Δ
dpp 88.70% <ø> (+0.15%) ⬆️
drive 86.25% <ø> (-0.01%) ⬇️
drive-abci 89.66% <ø> (+0.09%) ⬆️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.88% <ø> (ø)
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 48.02% <ø> (-1.58%) ⬇️
🚀 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.

QuantumExplorer added a commit that referenced this pull request Aug 5, 2026
One textual conflict and one semantic one.

`.github/workflows/tests-rs-workspace.yml`: #4287 collapsed the macOS job and
the Ubuntu backup job into a single `[self-hosted, rust-ci]` job and dropped the
cdylib->rlib strip step entirely. Took that structure, so this branch's edits to
the strip step fall away with the step itself (the surviving job already runs
cdylib crates such as rs-sdk-ffi unstripped). Kept this branch's addition of
platform-encryption and rs-unified-sdk-jni to the package list; the resolved
file is now exactly the base plus those two lines. The wallet workflow's
rs-unified-sdk-jni entry merged cleanly.

`DocumentQuery` gained an `offset` field in #4266 (ranked aggregate indexes,
protocol v14), so the three txMetadata query builders no longer compiled. All
three set `offset: None`: the encrypted-document scan pages by insertion-order
cursor, and `offset` is served only on the ranked surface — a skip-count page
would silently drop documents whenever the owner writes between round-trips.
The two test builders mirror the production query, so they take the same value.

cargo test -p platform-wallet -p platform-wallet-ffi -p rs-unified-sdk-jni:
710 / 267+26+6+9 / 52 passed, 0 failed.
cargo fmt --all -- --check and clippy --all-targets on the three crates: clean.
bfoss765 added a commit to bfoss765/platform that referenced this pull request Aug 5, 2026
…b into v41-keystore-qa5

Reconstruction of PR dashpay#4301 (feat/shielded-two-note-invites @d6610262b0) on top
of qa5's tip. dashpay#4301 is based on a current v4.2-dev point; merging it directly
would have dragged in 9 unrelated commits (dashpay#4287, dashpay#4266, dashpay#4279, dashpay#4276, dashpay#4278,
dashpay#4277, and duplicate dashpay#4183/dashpay#4191/dashpay#4251), including dashpay#4277's competing
encrypted-txMetadata implementation that collides with qa5's dashpay#4186.

The reconstruction cherry-picks ONLY dashpay#4301's own commit; the resulting delta is
byte-identical to the original (1256 insertions, 8 deletions across the same 11
files) — only hunk offsets differ.

Verified: platform-wallet 774/774, platform-wallet-ffi 284/284, dpp shielded
216/216 (incl. both multi/single-output fee-vs-action-count tests), the four
dashpay#4204 security tests, and dashpay#4301's three note-selection tests all pass.
rustfmt clean; no new clippy warnings.
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.

2 participants