Skip to content

ci: unblock v4.1-dev pipelines (Swift build, Docker images, contract tests, coverage cleanup) - #4205

Merged
QuantumExplorer merged 3 commits into
v4.1-devfrom
ci/fix-swift-warnings-and-coverage-cleanup
Jul 23, 2026
Merged

ci: unblock v4.1-dev pipelines (Swift build, Docker images, contract tests, coverage cleanup)#4205
QuantumExplorer merged 3 commits into
v4.1-devfrom
ci/fix-swift-warnings-and-coverage-cleanup

Conversation

@QuantumExplorer

@QuantumExplorerQuantumExplorer commented Jul 23, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Several v4.1-dev breakages that CI's path filters and PR-gating hide from ordinary pushes, but which fail any PR or full-pipeline run that exercises them:

  1. Swift SDK build fails on every PR that triggers it. The job compiles SwiftTests with warnings escalated to errors, and TestWallet.swift still called the broadcastTransaction wrapper deprecated by fix(wallet): trustless SPV broadcast acceptance with authoritative outcomes #4198. Base pushes skip the job (path filter), so only PRs see it — currently blocking fix(drive): strengthen execution proof result validation #4155 and fix(sdk): fail closed without proof verification #4168's dispatched run.
  2. Docker image builds fail (cargo chef prepare: failed to load manifest for dependency document-history-contract): feat(platform)!: document history system contract with per-doctype opt-in #4171 made the new crate a dependency of data-contracts, but the Dockerfile never copies it. This also takes down Test Suite and Dashmate E2E on full runs, which need the images. Both of the latest v4.1-dev branch runs fail on exactly this.
  3. keyword-search-contract unit tests were never valid: the spec was copy-pasted from wallet-utils-contract and tested a txMetadata document type this contract doesn't define — all nine cases threw raw WASM errors. The suite never ran in CI until ci: cover rs-unified-sdk-jni and missing contract crates in package filters #4203 added the missing package filters.
  4. document-history-contract asserted a minimum on purchase.price that the schema deliberately omits (the property stays an unbounded, sum-aggregatable i64; consensus validates actual amounts — per the schema's own description).
  5. The macOS coverage-cleanup retry loop broke on rm -rf exit status alone (CodeRabbit finding on fix(drive): strengthen execution proof result validation #4155; the file isn't part of that PR's diff, so the fix lands here).

What was done?

  • TestWallet.send() uses broadcastTransactionWithOutcome(_:), mapping rejected/unknown outcomes to the same errors the deprecated wrapper raised.
  • document-history-contract added to every Dockerfile package-copy block, mirroring token-history-contract.
  • keyword-search-contract spec rewritten against the real schema (contractKeywords, shortDescription, fullDescription). Two platform behaviors surfaced and are asserted as such: wrong-length identifier fields throw at document creation (identifier conversion precedes schema validation), and fullDescription's schema maxLength (10000) sits above the system per-field cap (5120), so overlength strings yield a field-size error.
  • document-history-contract price test asserts the type check plus the intentional absence of a schema minimum.
  • Coverage cleanup loop breaks only when removal succeeded and the directory is absent.

How Has This Been Tested?

keyword-search-contract: 20 passing locally against freshly built wasm-dpp; document-history-contract: 19 passing; both lints clean. TestWallet change mirrors the deprecated wrapper's own switch verbatim; the Swift CI job on this PR is the compile validation. Dockerfile/workflow changes are validated by this PR's image builds.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

The Swift SDK CI build compiles SwiftTests with warnings escalated to
errors, and the integration-test support wallet still called the
broadcastTransaction compatibility wrapper that #4198 deprecated, so any
PR triggering the Swift workflow now fails to build. Switch TestWallet
to broadcastTransactionWithOutcome and surface rejected/unknown outcomes
as the same errors the wrapper raised. The base branch never notices
because the Swift job is path-filtered and rs-only pushes skip it.
Also make the coverage-artifact cleanup retry loop break only when the
removal succeeded and target/llvm-cov-target is actually absent, so a
concurrently recreated directory is retried instead of silently kept.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@QuantumExplorer, you've reached your PR review limit, so we couldn't start this review.

Next review available in:37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2035149-f544-4e3b-b725-118de48c27f7

📥 Commits

Reviewing files that changed from the base of the PR and between bbad073 and acb83d9.

📒 Files selected for processing (4)
  • Dockerfile
  • packages/document-history-contract/test/unit/documentHistoryContract.spec.js
  • packages/js-evo-sdk/package.json
  • packages/keyword-search-contract/test/unit/searchContract.spec.js
📝 Walkthrough

Walkthrough

The macOS workflow now verifies LLVM coverage artifacts were removed. Swift integration tests now inspect transaction broadcast outcomes and return the transaction ID or throw outcome-specific errors.

Changes

macOS workflow cleanup

Layer / File(s)Summary
Verify coverage artifact removal
.github/workflows/tests-rs-workspace.yml
The cleanup step removes target/llvm-cov-target and confirms the directory is absent afterward.

Swift transaction broadcasting

Layer / File(s)Summary
Handle broadcast outcomes
packages/swift-sdk/SwiftTests/SwiftDashSDKIntegrationTests/Support/TestWallet.swift
TestWalletWrapper.send returns the transaction ID for accepted broadcasts and throws distinct errors for rejected or unknown outcomes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers:shumkov, llbartekll, zocolini

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title is concise and captures the CI pipeline unblock plus coverage cleanup/Swift build changes, matching the PR's main intent.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/fix-swift-warnings-and-coverage-cleanup

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.

@coderabbitaicoderabbitaiBot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/tests-rs-workspace.yml (1)

239-249: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the same existence check after exhausting retries.

The retry condition checks whether the path is absent with ! -e, but the final warning checks only -d. If the target is recreated as a file or symlink, cleanup can finish without warning even though target/llvm-cov-target still exists. Use -e consistently for the final verification (and the outer guard if non-directory artifacts are possible).

Proposed fix
- if [ -d target/llvm-cov-target ]; then+ if [ -e target/llvm-cov-target ]; then
echo "::warning::Coverage artifacts could not be fully removed"
fi
🤖 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-rs-workspace.yml around lines 239 - 249, Update the
cleanup verification around the target/llvm-cov-target retry loop to use the
same existence semantics throughout: replace the final directory-only check with
an existence check, and update the outer guard to -e as well if files or
symlinks may be present. Preserve the retry behavior and warning messages.
🤖 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.
Outside diff comments:
In @.github/workflows/tests-rs-workspace.yml:
- Around line 239-249: Update the cleanup verification around the
target/llvm-cov-target retry loop to use the same existence semantics
throughout: replace the final directory-only check with an existence check, and
update the outer guard to -e as well if files or symlinks may be present.
Preserve the retry behavior and warning messages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68af796a-dd7a-4e41-bbfb-40e9b33452cd

📥 Commits

Reviewing files that changed from the base of the PR and between 9bfcf6c and bbad073.

📒 Files selected for processing (2)
  • .github/workflows/tests-rs-workspace.yml
  • packages/swift-sdk/SwiftTests/SwiftDashSDKIntegrationTests/Support/TestWallet.swift

@codecov

codecovBot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.51%. Comparing base (9bfcf6c) to head (acb83d9).

Additional details and impacted files
@@ Coverage Diff @@## v4.1-dev #4205 +/- ##
=========================================
Coverage 87.51% 87.51% =========================================
Files 2667 2667 Lines 336972 336994 +22 =========================================
+ Hits 294903 294924 +21 - Misses 42069 42070 +1 
ComponentsCoverage Δ
dpp88.47% <ø> (ø)
drive86.24% <ø> (ø)
drive-abci89.58% <ø> (-0.01%)⬇️
sdk∅ <ø> (∅)
dapi-client∅ <ø> (∅)
platform-version∅ <ø> (∅)
platform-value92.90% <ø> (ø)
platform-wallet∅ <ø> (∅)
drive-proof-verifier49.79% <ø> (ø)
🚀 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.

Three more v4.1-dev breakages that only surface on full (dispatch or
version-change) CI runs:
- Docker image builds fail at cargo-chef prepare: #4171 made
document-history-contract a dependency of data-contracts but the
Dockerfile never copies the new crate. Add it everywhere
token-history-contract appears. This also broke Test Suite and
Dashmate E2E, which need the images.
- keyword-search-contract unit tests were copy-pasted from
wallet-utils-contract and still tested its txMetadata document type,
which this contract does not define; every case threw. Rewrite the
suite against the real schema (contractKeywords, shortDescription,
fullDescription). Two behaviors surfaced while doing so are asserted
as such: wrong-length identifier fields throw at document creation
(identifier conversion precedes schema validation), and fullDescription's
schema maxLength (10000) sits above the system per-field cap (5120),
so overlength strings yield a field-size error, not a maxLength error.
- document-history-contract asserted a minimum on purchase.price, but
the schema deliberately leaves the integer unbounded so the property
stays sum-aggregatable; consensus validates actual amounts. Assert
the type check and the intentional absence of a schema minimum
instead.
These suites were never exercised in CI before #4203 added the missing
package filters, and the contract-test jobs only run on full pipelines.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@QuantumExplorerQuantumExplorer changed the title ci: fix Swift warnings-as-errors build and harden coverage cleanup retryci: unblock v4.1-dev pipelines (Swift build, Docker images, contract tests, coverage cleanup)Jul 23, 2026
…f ts-node
The ts-node ESM loader is broken under the pinned Node 24 + Yarn PnP
combination: its vendored module resolver walks node_modules directories
that PnP never creates, so mocha dies with "Cannot find package
'ts-node'" before running a single test. The previous loader-invocation
fix (8cb06a9) shipped without its Tests job running (path filters),
so the breakage was never caught; the job now fails on every PR that
triggers it.
Node 24 strips type annotations natively, so mocha can consume the .ts
specs directly — no loader, no ts-node env vars. 212 mocha tests and the
karma browser suite pass locally under Node 24 + PnP.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit 552abfc into v4.1-devJul 23, 2026
41 checks passed
@QuantumExplorer
QuantumExplorer deleted the ci/fix-swift-warnings-and-coverage-cleanup branch July 23, 2026 01:16
Sign up for freeto 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

@QuantumExplorer