-
Notifications
You must be signed in to change notification settings - Fork 406
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: Added support for severity in sarif report #1587
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 the contribution! LGTM, just a minor nit.
internal/output/sarif.go
Outdated
@@ -2,10 +2,12 @@ package output | |||
|
|||
import ( | |||
"fmt" | |||
"github.com/google/osv-scanner/v2/internal/utility/severity" |
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.
This needs to go below the stdlib imports.
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.
Should be fixed now.
Fixed some tests I had missed and since there were some conflicts with main I rebased and force pushed to keep the PR clean and green. |
c8c4460
to
4e37d8e
Compare
The golangci-lint I think fails as a side effect of the other jobs failing and GitHub pulls the plug on the run. The other jobs fail as there is a new CVE since I updated the PR, so if I know when we will run the builds next I can make sure the PR is green before that time. As it seems to check live data there are new CVE:s popping up on and off. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1587 +/- ##
==========================================
+ Coverage 68.77% 68.79% +0.01%
==========================================
Files 199 199
Lines 18949 18961 +12
==========================================
+ Hits 13032 13044 +12
Misses 5221 5221
Partials 696 696 ☔ View full report in Codecov by Sentry. |
Adds severity to sarif reports.
This PR fixes #762
PS. I am not a proficient GO programmer so any and all feedback and ideas for improving this is appreciated.
The new fields are
properties
andseverity
in the example below, I added severity as a string to the bundle as that is how I interpret the GitHub docsA string representing a score that indicates the level of severity
.If no severity is available the field is left out.
This should hopefully be according to GitHub specification here: https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#reportingdescriptor-object