feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows#2086
feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows#2086mergify[bot] merged 15 commits intomainfrom
Conversation
|
@claude /pr-review |
|
Claude finished @Eikix's task in 8m 8s —— View job [AUTOMATED] PR Review: feat(ci): add cargo-llvm-cov code coverage to Rust CI workflows
SummaryGood initiative adding LLVM source-based coverage instrumentation to the Rust CI workflows. The approach of replacing 🔴 Issue 1: Coverage thresholds are dead code — never enforcedFiles: The The only effect of this file today is triggering CI re-runs when the JSON changes — which does nothing useful since the thresholds aren't enforced. The PR description mentions this is "for future enforcement," which is fine — but I'd recommend either:
Also, the PR description states thresholds of "40%/50%/60%" but the actual file has all three set to 🟡 Issue 2: Coverage profile inherits
|
…age only on coprocessor
1803cc8 to
af7a1fd
Compare
|
@claude /pr-review |
|
Claude finished @Eikix's task in 7m 25s —— View job [AUTOMATED] PR Review: feat(coprocessor): add cargo-llvm-cov code coverage to Rust CI workflows
SummaryClean, well-structured CI change that replaces I ran three parallel review agents (2× bug hunter, 1× error handling auditor) and validated all findings:
🟢 No Blocking IssuesNit:
|
| Aspect | Assessment |
|---|---|
| Pinned action SHAs | taiki-e/install-action@a37010ded... properly pinned with version comment |
| Cache key isolation | cargo-coverage- prefix prevents pollution between coverage and release builds |
| Coverage profile | opt-level = 1, debug = 1, lto = false — good balance of accuracy vs compile time |
| Non-blocking summary | Coverage printed to job summary without failing the build — appropriate for rollout |
if: always() on summary |
Correct pattern — shows coverage data even when tests fail, without masking failures |
rust-toolchain.toml |
llvm-tools-preview component enables local cargo llvm-cov usage too |
| Toolchain pinning | Changed from stable to "1.91.1" — matches rust-toolchain.toml, good for reproducibility |
Previous Review Items — Status
The earlier review raised several issues. Here's where they stand after the author's subsequent commits:
| # | Previous Issue | Status |
|---|---|---|
| 1 | Coverage thresholds are dead code | ✅ Fixed — ci/coverage-thresholds.json removed in af7a1fdc |
| 2 | Coverage profile inherits opt-level = 3 |
✅ Fixed — now uses opt-level = 1 in af7a1fdc |
| 3 | 2>/dev/null swallows errors |
⚪ Nit — kept as-is, acceptable for initial rollout (see above) |
| 4 | DB connection hang risk | ⚪ Not a real issue — cargo llvm-cov report reads profiling data from disk, doesn't connect to DB |
LGTM — this is ready to merge. 🚀
🧪 CI InsightsHere's what we observed from your CI run for fb2e99d. 🟢 All jobs passed!But CI Insights is watching 👀 |
1422c9c to
4ea96e1
Compare
|
@claude /pr-review |
There was a problem hiding this comment.
[AUTOMATED]
Code Review — PR #2086
Summary
This PR adds cargo-llvm-cov code coverage instrumentation to the coprocessor Rust CI workflow. It replaces cargo test --release with cargo llvm-cov using a new [profile.coverage] Cargo profile, and writes coverage results to the GitHub Actions job summary.
Files reviewed:
.github/workflows/coprocessor-cargo-tests.yml— CI workflow changescoprocessor/fhevm-engine/Cargo.toml— New[profile.coverage]sectioncoprocessor/fhevm-engine/rust-toolchain.toml— Addedllvm-tools-previewcomponent
What looks good
- Actions are properly pinned to SHA hashes (
taiki-e/install-action,dtolnay/rust-toolchain) - Cache key updated to avoid conflicts with old release-profile artifacts
- The
[profile.coverage]sensibly inherits fromreleasewithdebug = 1for source mapping and reducedopt-levelfor better instrumentation accuracy - Test step correctly does not have
|| true, so test failures will still fail the workflow - The
if: always()on the report step is appropriate for informational output rust-toolchain.tomlchange is consistent with the workflow toolchain pin
Issues found: 2 (non-blocking)
See inline comments below.
|
The review has been posted successfully. Here's a summary of what was done: Review Complete ✅I posted a code review on PR #2086 with: Review Summary (COMMENT — non-blocking)The PR is a solid CI enhancement that adds code coverage instrumentation. All actions are properly SHA-pinned, the coverage profile is well-configured, and test failures correctly propagate to fail the workflow. 2 Non-blocking Inline Comments (Nits)
Validated Non-Issues
|
|
@claude /pr-review |
There was a problem hiding this comment.
[AUTOMATED]
Code Review
✅ No issues found.
Reviewed for bugs, security issues, guideline compliance, and error handling across all 3 changed files:
.github/workflows/coprocessor-cargo-tests.yml— CI workflow additions forcargo-llvm-covcoveragecoprocessor/fhevm-engine/Cargo.toml— new[profile.coverage]sectioncoprocessor/fhevm-engine/rust-toolchain.toml—llvm-tools-previewcomponent added
Summary
This PR cleanly integrates LLVM-based code coverage into the coprocessor CI workflow. Key observations:
- Workflow structure is sound: Steps are correctly ordered — clean → test → report → export → diff-cover → comment
- Error handling is appropriate for CI: Non-blocking steps use
|| trueandif: !cancelled()consistently, with proper fallback messages when coverage data is unavailable - Actions are pinned by SHA: Both
taiki-e/install-actionandmarocchino/sticky-pull-request-commentfollow the repository's established pattern of SHA-pinned action references with version comments - Cargo profile is well-configured: The
[profile.coverage]inherits fromreleasewithdebug = 1added for source mapping — appropriate for instrumented coverage builds - Permissions are minimal: Only
pull-requests: 'write'was added, which is the minimum required for the sticky PR comment action - Cache key updated: The cache key change (
cargo→cargo-coverage) correctly avoids poisoning the existing cache with coverage-instrumented artifacts
Nit: The workflow specifies toolchain: "1.91.1" explicitly while rust-toolchain.toml already declares the same version — the action parameter is redundant since rustup respects the local toolchain file, but this is consistent with how coprocessor-cargo-clippy.yml and coprocessor-cargo-fmt.yml handle it, so no change needed.
LGTM 👍
|
The review has been posted. Here's a summary of what was done: PR #2086 Review Complete — No issues found. Four specialized review agents (2× bug hunting with opus, guideline compliance, error handling audit) analyzed the changes across 3 files. All agents confirmed the PR is clean:
The review was posted as an approving comment on the PR. |
Changed Lines CoverageCoverage of added/modified lines: N/A Per-file breakdownDiff CoverageDiff: origin/main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. |
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 2 hours 55 minutes 54 seconds in the queue, including 1 hour 54 minutes 44 seconds running CI. Required conditions to merge
|
Summary
cargo-llvm-cov(LLVM source-based instrumentation) to coprocessor Rust CI test workflowcargo test(not in addition to it) so overhead is minimal (~10% compile time)Related: https://github.com/zama-ai/fhevm-internal/issues/1146