Skip to content

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

Merged
akoeplinger merged 2 commits into
mainfrom
remove-nuget.org
Mar 20, 2026
Merged

akoeplinger merged 2 commits into
mainfrom
remove-nuget.org

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

Follow up to feedback from #5600

Remove nuget.org from auditSources during nuget-client VMR builds to prevent internet access at restore time instead of turning off NuGetAudit completely.

akoeplinger and others added 2 commits March 20, 2026 11:26
Remove nuget.org from auditSources during nuget-client VMR builds
to prevent internet access at restore time.

Co-authored-by: Copilot <[email protected]>
@akoeplinger
akoeplinger requested review from a team as code owners March 20, 2026 10:28
Copilot AI review requested due to automatic review settings March 20, 2026 10:28

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

This PR updates VMR repo-project build infrastructure to avoid NuGet restore-time internet access caused by NuGet audit in nuget-client, by removing the blocked nuget.org audit source from its NuGet.Config instead of disabling NuGet audit globally.

Changes:

  • Introduce an MSBuild task to remove blocked entries from the auditSources section of NuGet.config.
  • Wire the new task into the shared UpdateNuGetConfig flow, gated by a per-repo property.
  • Stop passing /p:NuGetAudit=false globally via repo-projects/Directory.Build.props.

Reviewed changes

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

File Description
repo-projects/nuget-client.proj Enables the new NuGet.config audit-source cleanup specifically for nuget-client builds.
repo-projects/Directory.Build.targets Registers and executes the new task during UpdateNuGetConfig when opted in.
repo-projects/Directory.Build.props Removes the prior global MSBuild argument that disabled NuGet audit.
eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/RemoveBlockedAuditSourcesFromNuGetConfig.cs Adds the new task that edits auditSources to remove blocked sources (e.g., nuget.org).

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

@akoeplinger
akoeplinger merged commit 5da0a6b into main Mar 20, 2026
15 checks passed
@akoeplinger
akoeplinger deleted the remove-nuget.org branch March 20, 2026 13:29
@akoeplinger

Copy link
Copy Markdown
Member Author

/backport to release/10.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0.1xx (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@akoeplinger backporting to release/10.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

git am output
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Revert "[main] Disable Nuget Audit in VMR builds (#5605)"
Applying: Add task to remove blocked audit sources from NuGet.config
Using index info to reconstruct a base tree...
M	repo-projects/Directory.Build.targets
M	repo-projects/nuget-client.proj
Falling back to patching base and 3-way merge...
Auto-merging repo-projects/Directory.Build.targets
CONFLICT (content): Merge conflict in repo-projects/Directory.Build.targets
Auto-merging repo-projects/nuget-client.proj
CONFLICT (content): Merge conflict in repo-projects/nuget-client.proj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0002 Add task to remove blocked audit sources from NuGet.config
Error: The process '/usr/bin/git' failed with exit code 128

Link to workflow output

akoeplinger added a commit that referenced this pull request Mar 20, 2026
Port of #5607 to release/10.0.1xx.

Remove nuget.org from auditSources during nuget-client VMR builds to
prevent internet access at restore time instead of turning off
NuGetAudit completely.

Co-authored-by: Copilot <[email protected]>
akoeplinger added a commit that referenced this pull request Mar 20, 2026
Port of #5607 to release/10.0.2xx.

Remove nuget.org from auditSources during nuget-client VMR builds to
prevent internet access at restore time instead of turning off
NuGetAudit completely.

Co-authored-by: Copilot <[email protected]>
github-actions Bot pushed a commit that referenced this pull request Mar 20, 2026
Port of #5607 to release/10.0.2xx.

Remove nuget.org from auditSources during nuget-client VMR builds to
prevent internet access at restore time instead of turning off
NuGetAudit completely.

Co-authored-by: Copilot <[email protected]>
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