Repository navigation
feat(check): emit SARIF 2.1.0 so findings land in the Security tab - #212
Merged
Merged
Conversation
check could only report an aggregate per signal, so three distinct protocol warnings reached CI as the string "has 3 warnings" and the report ended up in a zip nobody downloads. The store already knows which frame caused each one. Add --format sarif beside junit: one result per finding, carrying the session id, the frame Seq and the frame's own text, at level error for a signal named in --fail-on and note for one outside it, so the report follows the gate. All nine rules are declared on every run, clean or not, so a fixed finding closes its alert instead of staying open forever. A result points at the real 1-based line the envelope was decoded from, supplied by a new exporter.LoadFileLines: Seq is scoped per session and skips dropped frames, so writing it into startLine would send a reader to the wrong frame. The log path is made relative to the working directory when it sits under it, since code scanning resolves a result's path against the repository root, and a stdin run emits no location at all. Refs kerlenton#205
Owner
|
Great! Thank you! |
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.
Closes #205.
checkemitted text and JUnit but nothing code scanning could ingest, so findings could fail a build without ever becoming an alert. Adds--format sarif(SARIF 2.1.0).--fail-on; a clean run emits"results": [], notnullOne design note worth a look: the
errorsignal comes from a newEventView.Errored, set in the store wherever the session's error counter is incremented. Deriving it fromCall.Erroredinstead was wrong — some counted errors carry no call at all (a bare HTTP failure, an error response matching no request), and a task's terminal failure mutates its call in place, which anchored the alert at the call's first response. Marking the frame where it's counted keeps the report and the gate in sync by construction.README gains the
--formatsynopsis and anupload-sarifsnippet.Checklist
make checkpasses (gofmt, vet, staticcheck, race tests)