Skip to content

Re-enable NuGet audit for main (port of #6729) - #6753

Merged
marcpopMSFT merged 2 commits into
mainfrom
copilot/port-change-to-main
May 28, 2026
Merged

marcpopMSFT merged 2 commits into
mainfrom
copilot/port-change-to-main

Conversation

Copilot AI commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Port of #6729 to main. NuGet audit was disabled unconditionally as a workaround for dotnet/msbuild#10801, where WarningsNotAsErrors is mishandled for NuGet warnings, turning audit findings into hard errors in official builds. The fix scopes the disable to OfficialBuild only, restoring audit for local and CI dev builds.

Changes

  • Directory.Build.props — add <NuGetAudit Condition="'$(OfficialBuild)' == 'true'">false</NuGetAudit> alongside the existing offline-build condition
  • eng/tools/Directory.Build.props — add OfficialBuild-conditioned NuGetAudit=false
  • src/sdk/Directory.Build.props — replace unconditional NuGetAudit=false + TODO (dotnet/sdk#51466) with OfficialBuild-conditioned disable

@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team May 21, 2026 23:54
Copilot AI requested a review from marcpopMSFT May 21, 2026 23:54
@marcpopMSFT
marcpopMSFT marked this pull request as ready for review May 22, 2026 17:29
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner May 22, 2026 17:29
Copilot AI review requested due to automatic review settings May 22, 2026 17:29
@marcpopMSFT
marcpopMSFT requested a review from a team as a code owner May 22, 2026 17:29
…port fallback

Port of #6729 to main with fix for SkipArcadeSdkImport projects.

Projects like BinaryToolKit and MSBuildSdkResolver set
SkipArcadeSdkImport=true, which prevents Arcade SDK from being
imported. Since OfficialBuild is derived from OfficialBuildId by
Arcade's DefaultVersions.props, it was never set for these projects.

Add the OfficialBuild derivation to the SkipArcadeSdkImport fallback
block (which is documented as 'keep in sync with Arcade SDK') so the
NuGetAudit disable condition and all other properties that depend on
OfficialBuild work correctly for non-Arcade projects.

Co-authored-by: Copilot <[email protected]>
@marcpopMSFT
marcpopMSFT force-pushed the copilot/port-change-to-main branch from d183b13 to 45f6c5e Compare May 22, 2026 17:30
Comment thread eng/tools/Directory.Build.props Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Scopes the NuGet audit disablement to official builds to work around MSBuild’s mishandling of WarningsNotAsErrors for NuGet warnings, restoring audit behavior for developer builds.

Changes:

  • Disable NuGetAudit only when $(OfficialBuild) == 'true' (instead of unconditionally) in the SDK and tools build props.
  • Add an OfficialBuild default/derivation (when Arcade SDK import is skipped) and apply OfficialBuild-conditioned NuGetAudit=false at the repo level.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Directory.Build.props Adds OfficialBuild initialization (for non-Arcade imports) and disables NuGetAudit for official builds.
eng/tools/Directory.Build.props Disables NuGetAudit for official builds for eng/tools projects.
src/sdk/Directory.Build.props Replaces unconditional audit disable with an official-build-only disable and updates the rationale comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sdk/Directory.Build.props Resolved
Comment thread Directory.Build.props Resolved
@marcpopMSFT
marcpopMSFT merged commit 71ab427 into main May 28, 2026
11 checks passed
@marcpopMSFT
marcpopMSFT deleted the copilot/port-change-to-main branch May 28, 2026 17:29
mthalman pushed a commit to mthalman/dotnet that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants