Skip to content

Conversation

@martinrrm
Copy link
Contributor

Fixes: #52220

In a previous refactoring PR #51624, there was a missing SetAction to dotnet nuget trust subcommands that broke them.

Copilot AI review requested due to automatic review settings December 16, 2025 22:34
@martinrrm martinrrm requested a review from a team as a code owner December 16, 2025 22:34
Copy link
Contributor

Copilot AI left a comment

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 fixes a critical bug introduced in a previous refactoring (#51624) where the SetAction call was missing for all dotnet nuget trust subcommands (author, repository, source, certificate, remove, sync, and list). Without this action registration, the trust subcommands would fail to execute properly at runtime.

Key Changes:

  • Restores the SetAction(NuGetCommand.Run) call within the foreach loop that iterates over trust subcommands

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

This is not a correct fix. The command definition shouldn't set actions. That should be done in NuGetCommandParser.SetAction. The bug is that it doesn't do it recursively.

BTW, are there no tests covering this command?

@martinrrm
Copy link
Contributor Author

@tmat Pushed a change to do it recursively, and at the moment we don't have tests for this and other commands in this repo. We found this bug when our CI tests started failing.

@martinrrm martinrrm requested a review from tmat December 16, 2025 23:48
@martinrrm
Copy link
Contributor Author

@tmat Tests passed, can we merge this? I just realized the PR is pointing main, is that the correct branch?

@tmat
Copy link
Member

tmat commented Dec 17, 2025

I just realized the PR is pointing main, is that the correct branch?

Good catch - it should go to release/10.0.2xx. Please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotnet nuget trust command not working

4 participants