Repository navigation
Use SARIF module for vulns output - #271
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the vulns command’s SARIF output to use the shared github.com/git-pkgs/sarif module (generated SARIF 2.1.0 object model) instead of maintaining local inline SARIF structs, and adds a test that parses/validates the emitted SARIF.
Changes:
- Replace inline SARIF struct definitions in
cmd/vulns.gowithgithub.com/git-pkgs/sariftypes. - Generate SARIF output via
sarif.Log/sarif.Run/sarif.Resultand related model types. - Add a unit test that parses and validates the produced SARIF output.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| go.mod | Add github.com/git-pkgs/sarif v0.1.0 dependency. |
| go.sum | Record checksums for the new SARIF module dependency. |
| cmd/vulns.go | Switch SARIF generation to the external SARIF object model. |
| cmd/vulns_test.go | Add a SARIF parse/validate test for outputVulnsSARIF. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use build version for SARIF tool.driver.version instead of hardcoded 1.0.0 - Build run/driver locally and assign to report.Runs at the end - Fix inverted test failure messages for constructor default checks - go mod tidy to drop stale sarif v0.1.0 sum entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests