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

Output is not valid JSON if outputFormat=Json is requested #254

Open
jdvor opened this issue Oct 27, 2023 · 0 comments
Open

Output is not valid JSON if outputFormat=Json is requested #254

jdvor opened this issue Oct 27, 2023 · 0 comments

Comments

@jdvor
Copy link

jdvor commented Oct 27, 2023

CLI outputs invalid JSON when outputFormat=Json is requested. This defeats the whole purpose (further processing) of such output format.

Example:
dotnet-octo push --package="Skeleton.App_alpine-x64.1.1.0.tar.gz" --overwrite-mode=FailIfExists --space="Default" --timeout=300 --outputFormat=Json

Output:

Found space: Default (Spaces-1)
{
  "SuccessfulPackages": [],
  "FailedPackages": [
    {
      "Package": "/home/jan/dev/dotnet-daemon/artifacts/Skeleton.App_alpine-x64.1.1.0.tar.gz",
      "Reason": "There was a problem with your request.\n\n - A package with the same ID and version already exists. To proceed anyway, specify an overwriteMode of OverwriteExisting or IgnoreIfExists.\n"
    }
  ]
}

The stdout output is not valid JSON and could not be piped to tools like jq.

dotnet-octo --version
9.1.7

dotnet --info

.NET SDK:
 Version:   7.0.403
 Commit:    142776d834

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/share/dotnet/sdk/7.0.403/

Host:
  Version:      7.0.13
  Architecture: x64
  Commit:       3f73a2f186

.NET SDKs installed:
  6.0.416 [/usr/share/dotnet/sdk]
  7.0.403 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet/]

global.json file:
  /home/jan/dev/dotnet-daemon/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
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

No branches or pull requests

1 participant