-
Notifications
You must be signed in to change notification settings - Fork 184
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
Parse grype report without description #962
Conversation
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.
Thanks for your PR. The code looks good, just the test should be moved...
src/test/java/edu/hm/hafner/analysis/parser/GrypeParserWoDescriptionTest.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #962 +/- ##
=========================================
Coverage 93.07% 93.07%
Complexity 2371 2371
=========================================
Files 347 347
Lines 6588 6588
Branches 686 686
=========================================
Hits 6132 6132
Misses 256 256
Partials 200 200
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks! |
The element
"description"
is not always available for a"vulnerability"
in the JSON generated by Grype. This leads to the errorJSONObject["description"] not found.
Example to reproduce (using Grype version 0.71.0 with the vulnerability db built 2023-10-18 01:27:01 +0000 UTC):
To resolve this, I implemented a change to the
GrypeParser
, where the default value"Unknown"
is set if"description"
is missing.Testing done
I added a new test
GrypeParserWoDescriptionTest.java
to verify that a"vulnerability"
without"description"
can be parsed.I ran
mvn verify
, and all tests are green.Submitter checklist