-
Notifications
You must be signed in to change notification settings - Fork 33
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
Humanize v-e-c Task logs #1769
Humanize v-e-c Task logs #1769
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1769 +/- ##
==========================================
- Coverage 80.76% 80.74% -0.03%
==========================================
Files 68 68
Lines 4918 4954 +36
==========================================
+ Hits 3972 4000 +28
- Misses 946 954 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -160,6 +155,7 @@ spec: | |||
|
|||
- name: validate | |||
image: quay.io/enterprise-contract/ec-cli:snapshot | |||
onError: continue |
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.
Will the Task still fail if there's an error, e.g. invalid policy config is provided? I think so.
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.
What's the reason for adding this line? Maybe a comment is worthwhile.
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.
Added a comment, ec
could fail, for example because bad input was provided and the rest of the steps would be skipped, including the output of debug logs so we would loose valuable clues as to how to debug the issue
image: quay.io/enterprise-contract/ec-cli:snapshot | ||
command: [ec] | ||
args: | ||
- version |
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 some extra debug:
- name: images
...
echo "$(params.IMAGES)"
- name: policy-source
...
echo "($params.POLICY_CONFIGURATION)"
- name: policy
...
jq .policy < "$(params.HOMEDIR)/report-json.json"
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.
FYI, every step we add means a new container is created.
6314f3a
to
e2ec9f2
Compare
/retest |
This is useful so we can separate in contexts where stderr/stdout is not as clear, e.g. when running as a Tekton Task. Reference: EC-564
Makes showing of successes flag a field of the Report structure. Reference: EC-564
In addition to the global flag `--show-successes` that influences all outputs and this adds `--show-successes` equivalent per output format. This allows the full report with successes to be present in JSON or YAML outputs while the output in text format can be outputted without successes. This is done by appending options in URL query format to the output format following a question mark, e.g. `--output text=output.txt?show-successes=false`. Reference: EC-564
The top of the logfile for a TaskRun of verify-enterprise-contract Task should be the text (human readable) report. Following it are the YAML and JSON logs and preceded by a break `----- DEBUG OUTPUT -----` are the debug logs and version information. This is to make the TaskRun's logs easier to understand by humans. Reference: EC-564
@@ -159,6 +160,7 @@ func NewReport(snapshot string, components []Component, policy policy.Policy, da | |||
Data: data, | |||
PolicyInput: policyInput, | |||
EffectiveTime: policy.EffectiveTime().UTC(), | |||
ShowSuccesses: showSuccesses, |
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.
As discussed, should also have this one based on the --info flag:
+ ShowInfo: showInfo,
Could be done later.
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.
Looking at the code that might be a bit more work, so I'll file a separate story about this
The top of the logfile for a TaskRun of verify-enterprise-contract Task should be the text (human readable) report. Following it are the YAML and JSON logs and preceded by a break
----- DEBUG OUTPUT -----
are the debug logs and version information.This is to make the TaskRun's logs easier to understand by humans.
Also adds the
--logfile
parameter to redirect the logging to a file.Reference: EC-564