Skip to content

Use SARIF module for vulns output - #271

Merged
andrew merged 3 commits into
mainfrom
use-sarif-module
Jul 13, 2026
Merged

andrew merged 3 commits into
mainfrom
use-sarif-module

Conversation

@andrew

@andrew andrew commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • replace inline SARIF structs in the vulns command with github.com/git-pkgs/sarif v0.1.1
  • build SARIF output using the generated SARIF 2.1.0 object model
  • add a test that parses and validates generated SARIF output

Tests

  • go test ./cmd
  • go test ./...
  • go vet ./...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.go with github.com/git-pkgs/sarif types.
  • Generate SARIF output via sarif.Log / sarif.Run / sarif.Result and 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.

Comment thread cmd/vulns.go Resolved
Comment thread cmd/vulns_test.go Resolved
andrew added 2 commits July 13, 2026 02:50
- 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
@andrew
andrew merged commit ea95e7f into main Jul 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants