Skip to content

Add task to remove blocked audit sources from NuGet.config - #54318

Merged
mthalman merged 3 commits into
dotnet:release/9.0.1xxfrom
mthalman:nuget-audit
May 15, 2026
Merged

mthalman merged 3 commits into
dotnet:release/9.0.1xxfrom
mthalman:nuget-audit

Conversation

@mthalman

@mthalman mthalman commented May 14, 2026 •

Copy link
Copy Markdown
Member

Backport of dotnet/dotnet#5607

Resolves this error:

    /vmr/artifacts/source-built-sdks/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj : error NU1905: Warning As Error: Audit source 'nuget.org' did not provide any vulnerability data.
    /vmr/artifacts/source-built-sdks/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj : error NU1900: Warning As Error: Error occurred while getting package vulnerability data: Unable to load the service index for source https://api.nuget.org/v3/index.json.
        0 Warning(s)

Example build

@mthalman
mthalman requested a review from akoeplinger May 14, 2026 22:44
@mthalman
mthalman requested a review from a team as a code owner May 14, 2026 22:44
Copilot AI review requested due to automatic review settings May 14, 2026 22:44
@mthalman
mthalman requested a review from a team as a code owner May 14, 2026 22:44

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

Backports a source-build change to prevent NuGet Audit from attempting to reach nuget.org during offline/blocked CI restores by removing blocked entries from the auditSources section in generated NuGet.config files.

Changes:

  • Opt-in specific repo-project builds (xdt, nuget-client) to remove blocked audit sources via RemoveBlockedAuditSources=true.
  • Add and wire up a new MSBuild task (RemoveBlockedAuditSourcesFromNuGetConfig) into the UpdateNuGetConfig pipeline.
  • Introduce the new task implementation under Microsoft.DotNet.UnifiedBuild.Tasks.

Reviewed changes

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

File Description
src/SourceBuild/content/repo-projects/xdt.proj Enables RemoveBlockedAuditSources for xdt source-build project.
src/SourceBuild/content/repo-projects/nuget-client.proj Enables RemoveBlockedAuditSources for nuget-client source-build project.
src/SourceBuild/content/repo-projects/Directory.Build.targets Registers and invokes the new task during UpdateNuGetConfig.
src/SourceBuild/content/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/RemoveBlockedAuditSourcesFromNuGetConfig.cs Implements XML edit to remove blocked entries from auditSources.

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

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@mthalman
mthalman merged commit 17fbde9 into dotnet:release/9.0.1xx May 15, 2026
27 of 36 checks passed
@mthalman
mthalman deleted the nuget-audit branch May 15, 2026 17:28
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 7, 2026
@wtgodbe wtgodbe removed this from the 11.0-rc1 milestone Sep 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.

4 participants