Skip to content

ci: migrate Rust coverage from tarpaulin to cargo-llvm-cov#1279

Merged
guibeira merged 11 commits intomainfrom
migrate-to-cargo-llvm-cov
Mar 10, 2026
Merged

ci: migrate Rust coverage from tarpaulin to cargo-llvm-cov#1279
guibeira merged 11 commits intomainfrom
migrate-to-cargo-llvm-cov

Conversation

@guibeira
Copy link
Contributor

@guibeira guibeira commented Mar 10, 2026

Summary

  • Replaces cargo-tarpaulin with cargo-llvm-cov (LLVM source-based instrumentation — more accurate, faster CI)
  • Adds llvm-tools-preview rustup component (required by llvm-cov)
  • Installs via taiki-e/install-action@cargo-llvm-cov (prebuilt binary, no compile-from-source overhead)
  • Preserves all existing file exclusions and the 70% line coverage threshold
  • Removes tarpaulin.toml — exclusions now live as --ignore-filename-regex in ci.yml

Test Plan

  • Build Engine CI job passes on this PR
  • Coverage % is visible in the Run coverage step output
  • Local smoke test: 91.53% line coverage (above 70% threshold)
  • No other jobs affected

Summary by CodeRabbit

  • Chores
    • Updated CI and coverage tooling: switched to a new coverage runner and added required toolchain components, adjusted coverage command, thresholds, and exclusion patterns, consolidated engine build/test steps into a single step, updated build artifact path, removed legacy coverage configuration, and simplified CI step dependencies.

@vercel
Copy link
Contributor

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
iii-docs Ready Ready Preview, Comment Mar 10, 2026 6:46pm
motia-docs Ready Ready Preview, Comment Mar 10, 2026 6:46pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CI replaced cargo-tarpaulin with cargo llvm-cov via taiki-e/install-action@cargo-llvm-cov, added llvm-tools-preview to the Rust toolchain, updated coverage flags and ignore regex, removed tarpaulin.toml coverage config, consolidated engine test/release steps, updated artifact path to target/debug/iii, and removed needs: build-engine.

Changes

Cohort / File(s) Summary
CI workflow
/.github/workflows/ci.yml
Replaced tarpaulin setup with taiki-e/install-action@cargo-llvm-cov; added llvm-tools-preview to Rust components; changed coverage command to cargo llvm-cov with --target-dir target, --all-features, -p iii, --fail-under-lines 70, and an --ignore-filename-regex; removed explicit cargo test -p iii --all-features and cargo build -p iii --release steps; updated artifact path to target/debug/iii; removed needs: build-engine dependency.
Coverage config removed
tarpaulin.toml
Deleted tarpaulin-specific [coverage] configuration and the exclude-files list; tarpaulin config removed entirely.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant GH as GitHub Actions
    participant Tool as Rust Toolchain (rustup / llvm-tools-preview)
    participant Cov as cargo llvm-cov
    participant Artifact as Actions Artifact

    GH->>Tool: install toolchain + llvm-tools-preview
    GH->>Cov: run `cargo llvm-cov --target-dir target --all-features -p iii --fail-under-lines 70 --ignore-filename-regex ...`
    Cov-->>GH: coverage report + exit status
    GH->>Artifact: upload `target/debug/iii` artifact
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 I hopped through CI, swapped tools with a grin,
LLVM tucked in, the checks now begin.
Fewer steps to follow, one artifact to keep,
I twitch my nose happily — the pipeline sleeps neat.

🚥 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 pull request title accurately summarizes the main change: migrating Rust coverage tooling from tarpaulin to cargo-llvm-cov, which is the primary objective of the changeset.
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 migrate-to-cargo-llvm-cov

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.

Copy link
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/ci.yml (1)

35-35: Consider pinning to a version tag for reproducibility.

Using taiki-e/install-action@cargo-llvm-cov installs cargo-llvm-cov but doesn't pin the action version itself. For CI stability, consider pinning to a specific action version (e.g., taiki-e/install-action@v2) and specifying the tool explicitly:

- uses: taiki-e/install-action@v2
  with:
    tool: cargo-llvm-cov

This ensures consistent behavior across runs if the action's default behavior changes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 35, Replace the unpinned action reference
"uses: taiki-e/install-action@cargo-llvm-cov" with a pinned release tag and
explicit tool selection to ensure reproducible CI runs; update the uses line to
a specific version like "taiki-e/install-action@v2" and add a "with: tool:
cargo-llvm-cov" entry so the action is pinned while still installing
cargo-llvm-cov explicitly.
🤖 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/ci.yml:
- Line 35: Replace the unpinned action reference "uses:
taiki-e/install-action@cargo-llvm-cov" with a pinned release tag and explicit
tool selection to ensure reproducible CI runs; update the uses line to a
specific version like "taiki-e/install-action@v2" and add a "with: tool:
cargo-llvm-cov" entry so the action is pinned while still installing
cargo-llvm-cov explicitly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd8526cb-2f7d-4c70-b8ac-44c88e745c3d

📥 Commits

Reviewing files that changed from the base of the PR and between fb75eb7 and 2df8738.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tarpaulin.toml
💤 Files with no reviewable changes (1)
  • tarpaulin.toml

@guibeira guibeira force-pushed the migrate-to-cargo-llvm-cov branch from 19aeb14 to 2ef2bcc Compare March 10, 2026 17:50
Copy link
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.

Actionable comments posted: 1

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

44-45: Make the SDK exclusion regex robust to llvm-cov path formats.

Line 45 uses ^sdk/, which matches only repo-relative filenames. Since llvm-cov applies the regex to paths as recorded in the coverage mapping (which can be absolute or relative depending on compilation), absolute paths bypass this exclusion and cause coverage baseline drift. Use a pattern that matches sdk/ regardless of whether it appears at the start or after a path separator.

Suggested change
-          "engine/src/main\.rs|(cron|pubsub|queue|state|stream)/adapters/(redis_adapter|bridge)\.rs|queue/adapters/rabbitmq/|^sdk/"
+          "engine/src/main\.rs|(cron|pubsub|queue|state|stream)/adapters/(redis_adapter|bridge)\.rs|queue/adapters/rabbitmq/|(^|.*/)sdk/"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 44 - 45, The ignore-filename-regex
currently uses "^sdk/" which only matches repo-relative paths; update the regex
inside the --ignore-filename-regex string (the value containing
"engine/src/main\.rs|(cron|pubsub|queue|state|stream)/adapters/...|^sdk/") to
match "sdk/" whether it appears at the start or after a path separator by
replacing "^sdk/" with a pattern like "(?:^|/)sdk/" (ensure proper
escaping/quoting consistent with the YAML string).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 37-56: Add an explicit build step to produce the standalone binary
before the artifact upload: insert a run step that executes cargo build -p iii
(optionally with --target-dir target or --release if you need release binary)
after the "Run coverage" step and before the actions/upload-artifact step named
"iii-binary" so target/debug/iii exists when uploaded.

---

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 44-45: The ignore-filename-regex currently uses "^sdk/" which only
matches repo-relative paths; update the regex inside the --ignore-filename-regex
string (the value containing
"engine/src/main\.rs|(cron|pubsub|queue|state|stream)/adapters/...|^sdk/") to
match "sdk/" whether it appears at the start or after a path separator by
replacing "^sdk/" with a pattern like "(?:^|/)sdk/" (ensure proper
escaping/quoting consistent with the YAML string).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c287b919-59c8-408b-a554-d4602e36d06c

📥 Commits

Reviewing files that changed from the base of the PR and between 8cecb89 and 19aeb14.

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

Copy link
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.

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

37-56: ⚠️ Potential issue | 🔴 Critical

Add an explicit build step before uploading the artifact.

cargo llvm-cov runs tests via cargo test internally and produces test harnesses under target/debug/deps/, not a standalone binary at target/debug/iii. Without an explicit cargo build -p iii step, the artifact upload will fail or upload nothing, breaking all downstream jobs that depend on this binary (sdk-node-ci, sdk-python-ci, sdk-rust-ci, motia-js-ci, motia-py-ci).

Suggested fix
       - name: Run coverage
         run: >-
           cargo llvm-cov
           --all-features
           -p iii
           --fail-under-lines 70
           --ignore-filename-regex
           "engine/src/main\.rs|(cron|pubsub|queue|state|stream)/adapters/(redis_adapter|bridge)\.rs|queue/adapters/rabbitmq/|^sdk/"
 
       - name: Check formatting
         run: cargo fmt --all -- --check
 
       # - name: Run clippy
       #   run: cargo clippy -p iii -p function-macros -p iii-sdk --all-targets --all-features -- -D warnings
 
+      - name: Build engine binary
+        run: cargo build -p iii
+
       - uses: actions/upload-artifact@v4
         with:
           name: iii-binary
           path: target/debug/iii
           retention-days: 1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 37 - 56, The workflow is missing an
explicit build step before uploading the iii artifact, so add a step that runs
cargo build -p iii (or cargo build -p iii --release if you need release
artifacts) after the "Run coverage" step and before the
actions/upload-artifact@v4 step; ensure the new step has a descriptive name like
"Build iii binary" and produces the target/debug/iii path referenced by the
upload (or update the upload path if you build release).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/ci.yml:
- Around line 37-56: The workflow is missing an explicit build step before
uploading the iii artifact, so add a step that runs cargo build -p iii (or cargo
build -p iii --release if you need release artifacts) after the "Run coverage"
step and before the actions/upload-artifact@v4 step; ensure the new step has a
descriptive name like "Build iii binary" and produces the target/debug/iii path
referenced by the upload (or update the upload path if you build release).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f48e76bd-6cd4-46d5-8384-ad4e5ba3a325

📥 Commits

Reviewing files that changed from the base of the PR and between 19aeb14 and 2ef2bcc.

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

@guibeira guibeira merged commit 76952f9 into main Mar 10, 2026
20 checks passed
@guibeira guibeira deleted the migrate-to-cargo-llvm-cov branch March 10, 2026 19:12
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