Skip to content

feat: add SARIF output format to dowbench scan - #55

Open
samuelrojas-dev wants to merge 4 commits into
mainfrom
feat/sarif-scan-output
Open

samuelrojas-dev wants to merge 4 commits into
mainfrom
feat/sarif-scan-output

Conversation

@samuelrojas-dev

Copy link
Copy Markdown
Owner

Summary

  • Add --format sarif to dowbench scan for SARIF 2.1.0 output
  • Enables GitHub Code Scanning integration: findings show as code annotations in PRs
  • Severity mapping: high → error, medium → warning, low → note
  • Each finding includes a fix suggestion; rules are deduplicated
  • 4 new tests covering SARIF structure, empty reports, severity mapping, and CLI integration

Test plan

  • All 55 scan tests pass (pytest tests/test_scan.py -v)
  • Full suite: 371 passed, no regressions
  • SARIF output validates against the 2.1.0 schema structure
  • --format sarif works end-to-end via CLI

Generated by Claude Code

Add tests for count_tokens retry/exhaustion paths and begin_episode
delegation in RetryingProvider. Add direct tests for GeminiCodec
encode/decode with mocked google.genai types, passthrough paths,
and codec cache. provider_data.py goes from 69% to 100%, retry.py
from 89% to 94%.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WUfEahsTXEpnGdTvHgNdvD
Add `--format sarif` to produce SARIF 2.1.0 documents that GitHub Code
Scanning and other SARIF consumers understand, so dowbench scan can
gate a CI pipeline and surface findings as code annotations.

Severity mapping: high→error, medium→warning, low→note. Each finding
includes a fix suggestion. Rules are deduplicated across findings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WUfEahsTXEpnGdTvHgNdvD
With `format: sarif` and `upload-sarif: true`, the Action writes a
SARIF file and uploads it to GitHub Code Scanning via
github/codeql-action/upload-sarif, so findings appear as code
annotations on PRs. Requires security-events: write permission.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WUfEahsTXEpnGdTvHgNdvD
Remove unused Path import from report.py and break a 120-char line
in test_scan.py to stay within the 100-char limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WUfEahsTXEpnGdTvHgNdvD

This branch has not been deployed

No deployments
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