Dotnet list package json output implementation#4855
Merged
erdembayar merged 54 commits intodevfrom Nov 4, 2022
Merged
Conversation
2d69c1a to
9d12028
Compare
f9afd82 to
1d974c7
Compare
a637450 to
ee4f557
Compare
erdembayar
commented
Oct 19, 2022
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Show resolved
Hide resolved
erdembayar
commented
Oct 19, 2022
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
erdembayar
commented
Oct 19, 2022
| var projectAPath = Path.Combine(pathContext.SolutionRoot, "projectA.csproj"); | ||
| var projectBPath = Path.Combine(pathContext.SolutionRoot, "projectB.csproj"); | ||
|
|
||
| using (FileStream stream = new FileStream(consoleOutputFileName, FileMode.Create)) |
Contributor
Author
There was a problem hiding this comment.
Json output is redirected to consoleOutput.txt file. Later this file content compared to expected output for assertion.
f41ee35 to
abb5159
Compare
nkolev92
reviewed
Nov 2, 2022
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Show resolved
Hide resolved
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
....CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListReportPackage.cs
Outdated
Show resolved
Hide resolved
bf7a26c to
4ce40e8
Compare
4ce40e8 to
ff6b93b
Compare
nkolev92
reviewed
Nov 3, 2022
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageConsoleRenderer.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Core/NuGet.CommandLine.XPlat/ListPackage/ListPackageOutputContent.cs
Outdated
Show resolved
Hide resolved
nkolev92
approved these changes
Nov 3, 2022
This was referenced Nov 4, 2022
|
@nkolev92 @erdembayar I wanted to check if we have the same feature but for dependency graph relation. Something like showing child dependencies in the parent (Simply a dependency relation JSON graph). |
Contributor
Author
I don't believe we have one considering this is the 1st ever json output we have. You can create a feature request here. |
jeffkl
pushed a commit
that referenced
this pull request
Nov 8, 2022
* Dotnet list package machine readable output implementation
This was referenced Nov 10, 2022
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#7752
Regression? Last working version:
Description
Implement Dotnet List Package Machine Readable Json Output spec (spec PR), e.g.
dotnet list package --format jsonwill give you json output.If there any error with json generation then application will return
non-zerovalue.This PR also include MVC style refactoring of the existing
dotnet list packageto console output logic.Here get the report model/data
NuGet.Client/src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Line 38 in 7691366
consoleandjsonoutput options. So that means any existing tests like DotnetListPackageTests.cs already covers up untilNuGet.Client/src/NuGet.Core/NuGet.CommandLine.XPlat/Commands/PackageReferenceCommands/ListPackage/ListPackageCommandRunner.cs
Line 39 in 7691366
jsonreport Renderer implementation by passing report model.I added most basic unit tests, I'll add more later if needed.
PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation