Repository navigation
fix(reports): omit excerpts for unknown diff target kinds - #515
Merged
mldangelo-oai merged 5 commits intoOct 25, 2026
Merged
mldangelo-oai merged 5 commits into
mldangelo-oai merged 5 commits into
Conversation
3 tasks done
3 tasks done
sylvesterkaczmarek
force-pushed
the
fix/working-tree-diff-source-excerpt
branch
from
September 30, 2026 22:12
983c016 to
99cca6a
Compare
Contributor
Author
|
I resolved this PR against current main while preserving the intended fix and newer upstream behavior. The branch is now mergeable and no longer has a base conflict. Could a maintainer please re-review it when convenient? @codex review |
Refresh onto current main.
sylvesterkaczmarek
force-pushed
the
fix/working-tree-diff-source-excerpt
branch
from
October 1, 2026 09:34
99cca6a to
cf56e9b
Compare
Contributor
Author
|
The current |
mldangelo-oai
approved these changes
Oct 25, 2026
mldangelo-oai
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for sticking with this one. I checked the same saved scan before and after the fix: both get-scan and list-findings now leave out the misleading excerpt, and commit and range scans still show the right line. Looks good to me.
Contributor
Author
|
Thanks for taking another look and checking the saved scan before and after. Glad this one is in. |
Merged
3 tasks done
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.
Summary
Fixes #514. A saved diff scan can have a head revision without recording what kind of diff was scanned. In that case, reports could show a line from the commit even when the finding came from different text in the working tree.
Changes
Only use Git objects for a saved diff excerpt when the target kind is
commitorrange. The check happens before either stored source scopes or the fallback for older scans is used. The regression test exercises both paths and checks that standard scans still show their source.Testing
mainusing a sealed scan in a temporary Git repository. Bothget-scanandlist-findingsreturned it for a null target kind and for a simulated unrecognized kind. Both omit it with the fix. Commit and range excerpts still match the committed file; working-tree diffs still omit the excerpt.main. All 12 cases passed with the fix, as did all 40 related workbench tests and three SDK fixture scenarios.Risk and rollout
Only the optional source excerpt changes. Findings, locations, and sealed artifacts are untouched. Existing saved scans pick up the fix when read; no migration is needed.
Public disclosure review