Skip to content

SARIF ruleIndex and artifactLocation.index values are local reference… - #3149

Open
Jan Schlosser (castler) wants to merge 1 commit into
microsoft:mainfrom
castler:fix/deduplicate-after-remapping
Open

Jan Schlosser (castler) wants to merge 1 commit into
microsoft:mainfrom
castler:fix/deduplicate-after-remapping

Conversation

@castler

Copy link
Copy Markdown

SARIF ruleIndex and artifactLocation.index values are local references into each input run.

MergeCommand previously compared raw Result objects before RunMergingVisitor remapped those references, so semantically identical findings from separate logs could receive different indices and survive deduplication.

This is observable when merging CodeQL SARIF generated from two different databases.

Perform optional deduplication after RunMergingVisitor has canonicalized referenced rules, artifacts, logical locations, and invocations. Keep the behavior opt-in for other RunMergingVisitor consumers, and add a regression test covering equivalent results with different local rule and artifact indices.

@castler
Jan Schlosser (castler) force-pushed the fix/deduplicate-after-remapping branch from 7de64ae to a821b1d Compare August 13, 2026 13:30
@castler

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

…s into each input run.

MergeCommand previously compared raw Result objects before RunMergingVisitor remapped those references, so semantically identical findings from separate logs could receive different indices and survive deduplication.

This is observable when merging CodeQL SARIF generated from two different databases.

Perform optional deduplication after RunMergingVisitor has canonicalized referenced rules, artifacts, logical locations, and invocations. Keep the behavior opt-in for other RunMergingVisitor consumers, and add a regression test covering equivalent results with different local rule and artifact indices.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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