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
feat: add "vertical" output format #889
base: main
Are you sure you want to change the base?
Conversation
505d532
to
bae0efe
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #889 +/- ##
==========================================
+ Coverage 63.67% 64.10% +0.42%
==========================================
Files 146 148 +2
Lines 11960 12131 +171
==========================================
+ Hits 7616 7776 +160
- Misses 3878 3888 +10
- Partials 466 467 +1 ☔ View full report in Codecov by Sentry. |
b32bc50
to
9d20ff7
Compare
1e47759
to
181148d
Compare
I realised that the tests I've added here actually serve for all the |
181148d
to
e2e8479
Compare
e2e8479
to
b8ac63e
Compare
This introduces a set of crafted scanner results that each supported `output` format is run through to showcase how they look across all the different results possible from a scanner run - it originally started life as the tests for #889 but I realised they could base used more generally for testing and reviewing all the outputters, so here we are. ~It looks like this has also revealed the SARIF output is unstable in its ordering, which I'll aim to address in a dedicated PR~
b8ac63e
to
d5c8f4d
Compare
d5c8f4d
to
b266097
Compare
This adds a new "vertical" output format that is designed for humans and based on the output of
osv-detector
, which effectively aims to group the output relating to each entity being scanned in vertical slices:Unfortunately I think it suffers significantly due to the assumptions made by the rest of the codebase for outputting that made sense when the final output was a table i.e. we dump a lot of information as we go about scanning, config files, vulnerability filtering, and so on that really should be grouped but currently cannot because they're all outputted at different stages - I think a way to address that could be using some sort of event-emitter type pattern so that the reporters could be responsible for deciding what they actually do (e.g.
r.Emit("filtered-vulnerability", ...)
and then most reporters could choose to just print immediately, and ones like "vertical" could choose to add it to an internal struct), but I think that'll involve a lot more work; for now I'm just going to ignore the pre-results output.Resolves #85