Skip to content

fix(cmd): the SARIF names a nested finding's container in its message, never in a location outside the checkout - #583

Merged
thomasboni merged 1 commit into
mainfrom
fix/sarif-related-location-uri
Oct 30, 2026
Merged

thomasboni merged 1 commit into
mainfrom
fix/sarif-related-location-uri

Conversation

@thomasboni

Copy link
Copy Markdown
Contributor

What breaks

Since the nested actions resolution (#549), a nested finding's SARIF result carried the container line as a related location whose URI was the absolute GitHub blob URL. GitHub Code Scanning rejects the whole upload when any location, related ones included, has a URI scheme other than the checkout's:

Code Scanning could not process the submitted SARIF file:
SARIF URI scheme "https" did not match the checkout URI scheme "file"

Seen on invoke-ai/InvokeAI (run 41127816328, 2026-10-30): three ISSUE-307 findings pulled in via nschloe/action-cached-lfs-checkout, the upload step fails, the job fails even when the gate passes. Every repository with one nested finding and upload-sarif on is affected. It did not show on the outreach PR because fork PRs run with the upload disabled.

The fix

  • The container line closes the result message as an embedded link (SARIF 3.11.6, the syntax the message already uses for the issue code): (defined in [owner/action@ref, action.yml line N](blob url)). The url property keeps the link for SARIF viewers.
  • No relatedLocations any more; the result's one location stays the workflow step the user edits.
  • Direct findings and findings under a local outermost composite (ruling L2) are unchanged.
  • docs/GITHUB_ISSUES.md (ISSUE-701, ISSUE-703 sections) says what the SARIF carries now.

Tests

  • TestBuildSARIF_NestedResultNamesTheContainerInTheMessage (red before the fix): no related location, no location URI with a scheme anywhere in the serialized log, the container link as the nested message's tail, the direct message untouched.
  • make lint 0 issues, make deadcode only the CI-exempt ConfigSchemas, go vet clean, go test ./... green.

E2E against Code Scanning itself

On thomasboni/nested-actions-a (one nested finding chain), both SARIFs uploaded through the Code Scanning API for the same commit:

Binary Processing status
v0.7.16 failed: unrecognized SARIF location URI scheme "https" (three times)
this branch complete

The platform push uses the same SARIF builder, so platform mode is covered by the same change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FUFtr3m8zC2mVNKVTQvaNz

Comment thread cmd/nested_outputs_test.go Resolved
@thomasboni
thomasboni force-pushed the fix/sarif-related-location-uri branch from aa5af92 to f4f2de2 Compare October 30, 2026 22:55
Comment thread cmd/sarif.go Resolved
…, never in a location outside the checkout

GitHub Code Scanning rejects the WHOLE upload when any result location,
a related one included, carries a URI whose scheme is not the checkout's:
`SARIF URI scheme "https" did not match the checkout URI scheme "file"`
(invoke-ai/InvokeAI run 41127816328, 2026-10-30, three nested ISSUE-307
findings pulled in via nschloe/action-cached-lfs-checkout). Since 0.7.x a
nested finding carried the container line as a related location whose
URI was the absolute blob URL, so every repository with one nested
finding and `upload-sarif` on saw its job fail at the upload step.

The container line now closes the result message as an embedded link to
the blob URL (`(defined in [owner/action@ref, action.yml line N](url))`),
the same section 3.11.6 syntax the message already uses for the issue
code; the `url` property keeps the link for SARIF viewers. The result's
one location stays the workflow step the user edits. A direct finding
and a finding under a local outermost composite (ruling L2) are
unchanged.

Proven against Code Scanning itself on thomasboni/nested-actions-a: the
0.7.16 SARIF is refused with `unrecognized SARIF location URI scheme
"https"` three times, the fixed one processes to `complete`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUFtr3m8zC2mVNKVTQvaNz
@thomasboni
thomasboni force-pushed the fix/sarif-related-location-uri branch from f4f2de2 to 493155a Compare October 30, 2026 23:01
@thomasboni
thomasboni merged commit 5b53f2b into main Oct 30, 2026
16 checks passed
@thomasboni
thomasboni deleted the fix/sarif-related-location-uri branch October 30, 2026 23:10
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.

1 participant