Stop failing the build on low/moderate NuGet audit advisories#1660
Stop failing the build on low/moderate NuGet audit advisories#1660angularsen merged 1 commit intomasterfrom
Conversation
407cd42 to
c03aac5
Compare
c03aac5 to
9cad8ff
Compare
Code ReviewOverview: This PR fixes a CI breakage where transitive NuGet dependency vulnerabilities (from Correctness
Minor Observations
No concerns
Overall this is a clean, well-scoped fix with good inline documentation. The expanded comments explaining each warning code are a net improvement over the previous one-liners. |
PR #1657's CI failed at restore time with: error NU1901: Warning As Error: Package 'NuGet.Packaging' 7.0.1 has a known low severity vulnerability error NU1901: Warning As Error: Package 'NuGet.Protocol' 7.0.1 has a known low severity vulnerability These are pulled in transitively by build tooling (CodeGen) and cannot be upgraded without breaking other constraints. Two changes: - Add NU1901 (low) and NU1902 (moderate) to WarningsNotAsErrors in Directory.Build.props so they remain visible as warnings but no longer fail the build via TreatWarningsAsErrors. High (NU1903) and critical (NU1904) advisories still fail the build. - CodeGen.csproj had its own WarningsNotAsErrors that overrode (not appended to) the one in Directory.Build.props. Prefix it with $(WarningsNotAsErrors); so the project inherits the NU codes (and the obsolete codes) while keeping its nullability suppressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9cad8ff to
53b8011
Compare
- Microsoft.NET.Test.Sdk 18.0.1 -> 18.5.1 - NuGet.Protocol 7.0.1 -> 7.3.1 (clears the low-severity advisories flagged in #1660) - Serilog 4.3.0 -> 4.3.1 System.CommandLine.DragonFruit is left at the existing alpha; no newer version is published to the configured sources. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
## Summary Bumps centrally-managed NuGet package versions in [Directory.Packages.props](Directory.Packages.props) to the latest stable release. | Package | From | To | |---------|------|----| | Microsoft.NET.Test.Sdk | 18.0.1 | 18.5.1 | | NuGet.Protocol | 7.0.1 | 7.3.1 | | Serilog | 4.3.0 | 4.3.1 | `NuGet.Protocol` 7.3.1 clears the low-severity NU1901 advisories that triggered the original CI failure on #1657. As a result this PR makes #1660 unnecessary as a build-unblocker, though the comment-and-policy clean-up there still has independent value. `System.CommandLine.DragonFruit` is left at the existing `0.4.0-alpha.22272.1`; no newer stable version is published to the configured sources. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1660 +/- ##
======================================
Coverage 96% 96%
======================================
Files 450 450
Lines 29151 29150 -1
======================================
Hits 28109 28109
+ Misses 1042 1041 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Stops the build from failing on low/moderate NuGet audit advisories while keeping them visible as warnings.
Why
PR #1657's CI failed at restore time with:
These are pulled in transitively by build tooling (CodeGen) and cannot be upgraded without breaking other constraints.
Changes
NU1901(low) andNU1902(moderate) to<WarningsNotAsErrors>inDirectory.Build.props. They remain visible as warnings but no longer fail the build viaTreatWarningsAsErrors.NU1903(high) andNU1904(critical) still fail the build.CodeGen.csprojhad its own<WarningsNotAsErrors>that overrode (not appended to) the one inDirectory.Build.props. Prefix it with$(WarningsNotAsErrors);so the project inherits the NU codes (and the obsolete codes) while keeping its nullability suppressions.🤖 Generated with Claude Code