Skip to content

Ship only the rules the findings reference#8

Merged
satsura merged 1 commit into
mainfrom
fix/prune-sarif-rules
Jul 11, 2026
Merged

Ship only the rules the findings reference#8
satsura merged 1 commit into
mainfrom
fix/prune-sarif-rules

Conversation

@satsura

@satsura satsura commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

A scan of a large repository failed to upload with HTTP 413. It had 508 findings — but the merged SARIF was tens of megabytes, because Semgrep and Checkov embed their entire rule catalogue in tool.driver.rules, thousands of definitions with long help texts, whether or not anything matched.

The merge step now keeps only the rules a run's results actually reference, rewrites each result's ruleIndex to the pruned array, and drops the prose fields (help, fullDescription) while keeping what the backend reads: security-severity (severity mapping), shortDescription and helpUri.

Measured on the K repository: 0.6 MB → 50 KB. An unresolvable ruleIndex is dropped rather than left pointing at the wrong rule.

@satsura satsura merged commit d52547e into main Jul 11, 2026
3 checks passed
@satsura satsura deleted the fix/prune-sarif-rules branch July 11, 2026 13:27
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