Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet package list command should restore first #47873

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Nigusu-Allehu
Copy link
Member

@Nigusu-Allehu Nigusu-Allehu commented Mar 25, 2025

#47400 had to many conflicts.
Fixes: NuGet/Home#13406

Description

This PR

ScreenShots

  • package list --project [project]
    image

  • --format json
    image

  • restore error
    image

  • restore error: --format json
    image

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Mar 25, 2025
@Nigusu-Allehu Nigusu-Allehu self-assigned this Mar 25, 2025
@Nigusu-Allehu Nigusu-Allehu marked this pull request as ready for review March 25, 2025 17:08
@Nigusu-Allehu Nigusu-Allehu requested a review from a team as a code owner March 25, 2025 17:08
@Nigusu-Allehu Nigusu-Allehu force-pushed the dev-nyenework-dlp-implicit-restore branch from 5ff051a to a8235d6 Compare March 26, 2025 15:04

private int RunRestore(string projectOrSolution, ReportOutputFormat formatOption)
{
MSBuildForwardingApp restoringCommand = new MSBuildForwardingApp(argsToForward: ["-target:restore", projectOrSolution, "-noConsoleLogger"]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the implicit restore isn't logging anything, what if its takes more than a few seconds? I think the user might think something is wrong. We could pass console logger parameters to produce some output

-consoleLoggerParameters:Verbosity=Minimal;NoSummary

Copy link
Member

Choose a reason for hiding this comment

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

We should try to align with test and run here and use the same logger configuration - ideally this would use terminal logger by default like every other command in the CLI.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not so sure, the output of this command is the information about the packages that a project is referencing. Its not running tests (which are potentially long running) and its not building a project and its dependencies.

The only reason we need to run restore first is because the project.assets.json file provides all of the information and we want to make sure its up-to-date. The only reason I propose we have any output at all about restore is in the case that it takes a while, I don't want users to think that dotnet list package is hung.

@Nigusu-Allehu Nigusu-Allehu requested a review from jeffkl March 28, 2025 20:08
@Nigusu-Allehu Nigusu-Allehu requested review from zivkan and Forgind March 28, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet list package doesn't restore
5 participants