Fix Grpc.Net.ClientFactory version range check - Fixes #7565#7566
Conversation
|
@dotnet-policy-service agree company="Microsoft" |
a2c32db to
7895395
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds resilience build-transitive validation for Grpc.Net.ClientFactory versions and tests to ensure version parsing no longer fails on non-System.Version NuGet version formats.
Changes:
- Parse comparable versions from
PackageReference/PackageVersion/ transitiveReferencePathusing a regex to avoidMSB4184when versions are ranges or include prerelease labels. - Emit warnings based on the parsed comparable version instead of the raw NuGet version string.
- Add integration-style tests that run
dotnet msbuildagainst a temporary project to verify warning/no-warning behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/Libraries/Microsoft.Extensions.Http.Resilience.Tests/BuildTransitive/GrpcNetClientFactoryVersionTargetTests.cs | New tests that execute the MSBuild target and assert warnings are/aren’t emitted for various version sources and formats. |
| src/Libraries/Microsoft.Extensions.Http.Resilience/buildTransitive/Microsoft.Extensions.Http.Resilience.targets | Updates the target to extract a comparable numeric version via regex before calling MSBuild::VersionLessThan. |
|
Update on the remaining The same issue is being tracked/fixed separately in #7561: This PR’s WarningsCheck issue from the test helper has been addressed in |
e8fa206 to
892d086
Compare
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1464903&view=codecoverage-tab |
892d086 to
911bf59
Compare
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1465046&view=codecoverage-tab |
911bf59 to
0c487a8
Compare
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1465182&view=codecoverage-tab |
0c487a8 to
4c7e573
Compare
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1465941&view=codecoverage-tab |
4c7e573 to
eecced7
Compare
|
Hi @iliar-turdushev / @evgenyfedorov2 - apologies for the ping. The fix is small (2 files). Note on the CI failure on the latest run: it's unrelated to this change. Build fails during Whenever either of you has a moment to take a look, that'd be much appreciated. |
eecced7 to
dc0465c
Compare
🎉 Good job! The coverage increased 🎉
Full code coverage report: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1489843&view=codecoverage-tab |
92014e1 to
cfef2fe
Compare
…ld target (dotnet#7566) The _CheckGrpcNetClientFactoryVersion MSBuild target called VersionLessThan on raw NuGet version strings, failing when versions use bracket notation (e.g., [2.80.0]). Extract a comparable numeric version via regex so the target tolerates bracket-pinned and pre-release version strings. Add test coverage for unpinned and bracket-pinned version formats. Fixes dotnet#7565
cfef2fe to
1c7cd92
Compare
…ld target (dotnet#7566) The _CheckGrpcNetClientFactoryVersion MSBuild target called VersionLessThan on raw NuGet version strings, failing when versions use bracket notation (e.g., [2.80.0]). Extract a comparable numeric version via regex so the target tolerates bracket-pinned and pre-release version strings. Add test coverage for unpinned and bracket-pinned version formats. Fixes dotnet#7565
1c7cd92 to
f1cae36
Compare
…ld target (dotnet#7566) The _CheckGrpcNetClientFactoryVersion MSBuild target called VersionLessThan on raw NuGet version strings, failing when versions use bracket notation (e.g., [2.80.0]). Extract a comparable numeric version via regex so the target tolerates bracket-pinned and pre-release version strings. Add test coverage for unpinned and bracket-pinned version formats. Fixes dotnet#7565
f1cae36 to
f67e5bb
Compare
Fixes #7565
Summary
Grpc.Net.ClientFactoryNuGet version metadata before callingVersionLessThanin theMicrosoft.Extensions.Http.ResiliencebuildTransitive target.[2.80.0]without failing the build withMSB4184.PackageReference.VersionPackageReference.VersionOverridePackageVersion.VersionReferencePath.NuGetPackageVersionValidation
./restore.sh./.dotnet/dotnet test test/Libraries/Microsoft.Extensions.Http.Resilience.Tests/Microsoft.Extensions.Http.Resilience.Tests.csproj --filter GrpcNetClientFactoryVersionTargetTests --no-restore -v:minimal./build.sh --vs Polly,Resilience./build.sh --build --testMicrosoft Reviewers: Open in CodeFlow