grype icon indicating copy to clipboard operation
grype copied to clipboard

Consistent sort order for grype output

Open exortech opened this issue 2 years ago • 5 comments

What would you like to be added: It would be fantastic if the output produced by grype was consistently ordered. It does appear to be sorted by NAME, but a secondary sort by VULNERABILITY would ensure that the output is rendered consistently across runs.

Why is this needed: We commit the output of our grype runs to version control after updating dependencies. The inconsistent sorting creates unnecessarily complex diffs.

exortech avatar Apr 05 '22 22:04 exortech

I agree with the value of this enhancement. The proposed "consistently rendered output", any consistent sort whatsoever, makes diffs possible.

freedom-isnotanarchy avatar Apr 06 '22 02:04 freedom-isnotanarchy

:heavy_plus_sign: :one: for this one :smile_cat:

adriens avatar Apr 08 '22 08:04 adriens

Also, is sorted from Critical-> Negligible it would make | head much more interesting as people usually are looking for the worst one.

So finally it leads to make grype more efficient for end user :muscle: :pray:

adriens avatar Apr 14 '22 08:04 adriens

Thanks for the issue @exortech! This looks like a pretty good option for a community PR or first issue if anyone on this thread wants to take a stab. If not I'll try and get around to this as soon as I have some time.

spiffcs avatar Jun 01 '22 13:06 spiffcs

➕ 1️⃣ for this one

maqzee-git avatar Jun 04 '22 01:06 maqzee-git

I've added a PR to this issue for the table sort - if that's what we're looking for I'll go ahead and get one added for machine readable formats

spiffcs avatar Jul 25 '23 18:07 spiffcs

This was closed because the table sort PR was merged - there are some small follow up coming for the other presenters here as well.

spiffcs avatar Jul 26 '23 16:07 spiffcs