fix(cargo-anvil): scope coverage reports to affected packages - #190
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The checked-in recipe and lock are stale, and workspace-mode report behavior lacks contract coverage.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Scopes LCOV exports to the affected packages used for testing and coverage gating.
Changes:
- Pass package selectors to
cargo llvm-cov report. - Preserve workspace behavior and Windows fallback.
- Add contract coverage, update snapshots, and document the scope.
File summaries
| File | Summary |
|---|---|
crates/cargo-anvil/tests/snapshots/snapshots__local_only.snap |
Refreshes local generated output. |
crates/cargo-anvil/tests/snapshots/snapshots__github_backend.snap |
Refreshes GitHub generated output. |
crates/cargo-anvil/tests/snapshots/snapshots__ado_backend.snap |
Refreshes ADO generated output. |
crates/cargo-anvil/tests/recipe_contracts.rs |
Adds affected-package report-scope coverage. |
crates/cargo-anvil/templates/justfiles/anvil/checks/llvm-cov.just |
Scopes reports; critical: regenerate the checked-in recipe and lock, and moderate: add workspace-mode coverage. |
crates/cargo-anvil/docs/design/checks.md |
Documents scoped coverage reports. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (97.6%) is below the target coverage (100.0%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
=====================================
Coverage 97.6% 97.6%
=====================================
Files 304 304
Lines 69683 69683
=====================================
+ Hits 68016 68018 +2
+ Misses 1667 1665 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Revert the version bump or complete the repository release process, including changelog updates.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 9/11 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The contract test does not verify repeated package selectors, leaving a regression gap.
Review details
Suppressed comments (1)
crates/cargo-anvil/tests/recipe_contracts.rs:2332
- This contract covers only one scoped
--packagepair. The impact format allows repeated selectors (--package A@v --package B@v), so a regression that drops or mis-splats subsequent package arguments would still pass while the production coverage set contains multiple affected packages. Add a multi-package case and assert that both report invocations preserve every selector.
("--package measured@0.1.0", "llvm-cov report --package measured@0.1.0 --lcov", true),
- Files reviewed: 10/12 changed files
- Comments generated: 0 new
- Review effort level: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 Scope generated LCOV exports to the same affected-package set used for test execution and
cargo-coverage-gate.Problem
anvil-llvm-covruns tests for impacted packages but currently invokescargo llvm-cov reportwithout those package selectors. The exported LCOV therefore includes instrumented, unselected workspace dependencies whose own tests did not run.cargo-coverage-gatefilters them back out, while Codecov and ADO ingest the unfiltered report and can report misleading project and patch coverage failures.This was observed in microsoft/oxidizer#767: every affected package passed the local 100% gate, while Codecov reported 97.8% project coverage from the same run.
Change
cargo llvm-cov reportinvocation--workspacebehavior for unscoped runsValidation