Skip to content

Initial dotnet package update command#6459

Merged
zivkan merged 8 commits intodevfrom
dev-zivkan-dotnet-package-update
May 20, 2025
Merged

Initial dotnet package update command#6459
zivkan merged 8 commits intodevfrom
dev-zivkan-dotnet-package-update

Conversation

@zivkan
Copy link
Member

@zivkan zivkan commented May 15, 2025

Bug

Fixes: NuGet/Home#14305

Description

  • Adds the initial dotnet package update command
    • Only adds it to NuGet.CommandLine.XPlat. The dotnet/sdk repo will need a change after this version of NuGet is inserted, in order to for the dotnet CLI to know that this command is available.
  • As per the linked issue, it is intentionally minimal. Please see Add dotnet package update command Home#14304 for a list of sub-issues that are planned to improve the command
    • Only supports updating 1 package at a time
    • Only supports a single project, or a solution with a single project.
  • Gets restore inputs via running msbuild as a child process. This is similar to what dotnet package add does, except package add does the child process in the dotnet/sdk repo, while package update does it with code in the NuGet.Client repo. However, all of this is (hopefully) temporary. A few weeks ago I added PackageSpecFactory and one of the intended goals was to enable easily creating the DGSpec in-process in dotnet CLI commands (as well as consolodating the existing 4 PackageSpec creation methods into 1). However, to save time, this code is doing the child process for now.
  • Small changes to package add code so it's reusable for package update. That code is going to need heavy refactoring to make it support multiple packages and multiple projects, but it was quick to get this initial implementation done.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@zivkan zivkan requested a review from a team as a code owner May 15, 2025 07:40
@zivkan zivkan requested review from jeffkl, martinrrm and nkolev92 May 16, 2025 11:50
jeffkl
jeffkl previously approved these changes May 19, 2025
Copy link
Contributor

@donnie-msft donnie-msft left a comment

Choose a reason for hiding this comment

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

Requesting changes only for the localized String questions/suggestions.

Overall, looks great and I'm wondering if there's some reuse for the VS update command here in the future.

nkolev92
nkolev92 previously approved these changes May 19, 2025
Copy link
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

LGTM.
Donnie has some strings feedback, but after that 🚢 it.

@zivkan zivkan dismissed stale reviews from nkolev92 and jeffkl via 65ec7e5 May 20, 2025 06:29
@zivkan zivkan requested review from donnie-msft, jeffkl and nkolev92 May 20, 2025 07:06
Copy link
Contributor

@donnie-msft donnie-msft left a comment

Choose a reason for hiding this comment

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

Localized string comments appear to be resolved now.

@zivkan zivkan merged commit 475da54 into dev May 20, 2025
20 of 21 checks passed
@zivkan zivkan deleted the dev-zivkan-dotnet-package-update branch May 20, 2025 23:15
@zivkan zivkan mentioned this pull request Sep 16, 2025
3 tasks
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.

dotnet package update initial version

5 participants