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
support json and yaml format outputs #31
support json and yaml format outputs #31
Conversation
8ad23cd
to
a510490
Compare
/cc @cpanato |
dependencies/versions.go
Outdated
@@ -21,6 +21,12 @@ import ( | |||
"github.com/pkg/errors" | |||
) | |||
|
|||
type VersionUpdate struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a note that this is also the external schema for the JSON/YAML output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
version: 0.0.1 | ||
upstream: | ||
flavour: dummy | ||
url: example/example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: new line
cmd/validate.go
Outdated
} | ||
|
||
if o.outputFile != "" && o.outputFormat == "" { | ||
logrus.Warnf("ignoring --output-file as not --output-format is not specified") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we can output to a file the log
format or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
As mentioned in the description of the --output-file flag, it is only used if the output format is yaml
or json
.
If the output-format is log
it will print the output to stdout (as before).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few nits and comments
thanks for doing this!
a510490
to
eda4add
Compare
eda4add
to
cc65793
Compare
5180d62
to
cd910d8
Compare
/test pull-zeitgeist-verify |
This command support formatted output. Supports JSON and YAML.
cd910d8
to
31b73b8
Compare
@justaugustus rebased and now implements the logic under a new |
@ykakarap -- Thanks so much for this functionality! /hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justaugustus, ykakarap The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
This PR add support for formatted outputs.
The following formats are supported:
Zeitgiest can be used by other systems, like build systems, to form further actions on the outputs.
Providing machine readable outputs allows zeitgeitst's outputs to be consumed by downstream settings.
Adds
--output-format
to specify the format of the output. Supported values areyaml
,json
andlog
(default).Adds
--output-file
to specify the file if format isyaml
orjson
. Defaults todependencies_output.(yaml|json)
.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Yes