fix(ci): restore net472 PublicAPI tests on Windows - #6857
Conversation
Microsoft.Testing.Extensions.CodeCoverage 18.11+ (pulled in transitively via TUnit, bumped in #6717) bundles its own netstandard2.0 Mono.Cecil.dll in lib/. It overwrites the net40 Mono.Cecil build in the net472 output. The netstandard2.0 Cecil build cannot resolve .NET Framework facades, so PublicApiGenerator fails with "Failed to resolve assembly: 'netstandard'". Exclude the CodeCoverage package from TUnit.PublicAPI (coverage is never collected there) so the net40 Cecil build is copied again. Remove the stale pin comment in Directory.Packages.props.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe public API test project now excludes all CodeCoverage package assets. This prevents its transitive ChangesPublic API build compatibility
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains in this test-project compatibility change. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. A rabbit checks the public API trail Comment |
|
Review: fix(ci): restore net472 PublicAPI tests on WindowsSmall, well-scoped fix. I traced the dependency chain ( No correctness or architectural issues. One minor, non-blocking observation:
Other automated reviewers (CodeRabbit, Greptile, Codex) found no issues either. Approving from a correctness standpoint. |
Problem
The
modularpipeline (windows-latest)job has failed on every PR since #6717.RunPublicAPITestsModulefails for net472 in three tests:Root cause
#6717 bumped
Microsoft.Testing.Extensions.CodeCoveragefrom 18.10.0 to 18.11.2. The package reaches the project transitively throughTUnit. Starting with 18.11, the package ships its own netstandard2.0Mono.Cecil.dllinlib/. That file overwrites the net40Mono.Cecil.dllfrom theMono.Cecilpackage in the net472 output folder. I checked this by hash: the output file matchesmicrosoft.testing.extensions.codecoverage/18.11.2/lib/netstandard2.0/Mono.Cecil.dll.The netstandard2.0 build of Cecil can't resolve .NET Framework facades: it has no GAC or framework-directory lookup. So PublicApiGenerator can't resolve
netstandard.Fix
TUnit.PublicAPI, referenceMicrosoft.Testing.Extensions.CodeCoveragedirectly withExcludeAssets="all". These tests never collect coverage, so this change only brings back the net40 Cecil build.Directory.Packages.props. The comment no longer applied because the version is already 18.11.2.Verification
Ran locally on Windows:
Mono.Cecil.dllis the net40 build again.Summary by CodeRabbit
Bug Fixes
Maintenance