cli icon indicating copy to clipboard operation
cli copied to clipboard

Unexpected differences between json and basic cli output (--output-format json not working)

Open mieliespoor opened this issue 2 years ago • 1 comments

The bug

When creating a release and supplying the flag --output-format json, the response is vastly different to when omitting that flag (thus returning basic string format).

Command to reproduce

Basic formatting

octopus release create  --project "project.name" --version 1.4.4 --package-version 1.4.4 --channel Release --release-notes "auto created from build pipeline." --space "Default" --no-prompt

Successfully created release version 1.4.4.1 using channel Release

View this release on Octopus Deploy: https://octopus.domain.com/app#/Spaces-1/releases/Releases-297773

octopus release create  --project "project.name" --version 1.4.4 --package-version 1.4.4 --channel Release --release-notes "auto created from build pipeline." --space "Default" --no-prompt --output-format json
{"ReleaseNotes":"","Assembled":"0001-01-01T00:00:00Z","Channel":"Release","Version":"1.4.4.1"}

Outcome

The expectation is that in the json output, I would at the very least get back the release id, in this case Releases-297773. Without that we need to now do a second call to try and get the release id, or we need to do string manipulation on the basic output to get the release id / link.

Versions

cli: I don't know as the cli doesn't have a way to tell me what version it is!

Octopus Server: 2023.2

Links

mieliespoor avatar Oct 04 '23 09:10 mieliespoor

I confirmed this in CLI Go 1.6.2: image

Here is what this looks like in the CLI 9.1.7: image

donnybell avatar Oct 04 '23 10:10 donnybell