-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
refactor(report): write tables after rendering all results #8357
base: main
Are you sure you want to change the base?
refactor(report): write tables after rendering all results #8357
Conversation
pkg/report/table/table.go
Outdated
_, _ = fmt.Fprint(tw.Output, tw.vulnerabilityRenderer.Flush()) | ||
_, _ = fmt.Fprint(tw.Output, tw.misconfigRenderer.Flush()) | ||
_, _ = fmt.Fprint(tw.Output, tw.secretRenderer.Flush()) | ||
_, _ = fmt.Fprint(tw.Output, tw.pkgLicenseRenderer.Flush()) | ||
_, _ = fmt.Fprint(tw.Output, tw.fileLicenseRenderer.Flush()) |
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.
I think we can pass bytes.Buffer to each renderer rather than each renderer holding its own buffer. The buffer will be flushed at the end.
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.
something like 4e93197?
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.
Yes 👍
@danielciuraru86 We want to change the interface of |
Description
We need to use the one renderer (for each result Type) for all results, for the correct operation of logs, once functions, etc.
Current logic
New logic
Report
.FilePath log mistake example:
before:
after:
➜ ./trivy -d rootfs --scanners vuln,secret /Users/dmitriy/work/tmp/8177 ... 2025-02-05T14:57:07+06:00 INFO Table result includes only package filenames. Use '--format json' option to get the full path to the package file. Java (jar) Total: 4 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 2, CRITICAL: 0) ... Node.js (node-pkg) Total: 5 (UNKNOWN: 0, LOW: 0, MEDIUM: 2, HIGH: 2, CRITICAL: 1) ...
Checklist