feat(findings): keyed by the code they flag, not its line number (#491) (#497)
CI / Check (push) Skipped
CI / Detect Changes (push) Successful in 3s
CI / Deploy Docs (push) Successful in 1m12s
CI / Deploy MCP (push) Successful in 5m29s
CI / Deploy Dashboard (push) Successful in 7m31s
CI / Deploy Agent (push) Successful in 9m24s

This commit was merged in pull request #497.
This commit is contained in:
sharang committed 2026-10-06 10:35:14 +00:00
1 parent bdf7fa4268
commit ece992da32
8 files changed
+531 -8

No files matched your search

+8 -3
View File
@@ -183,9 +183,14 @@ What the scan never changes:
- A scheduled scan that finds no new commits (or unchanged uploaded files) does
not scan, so it closes nothing.
Findings are tied to a file and line. When code moves (lines added above it),
the same issue is reported at its new line as a new finding, and the old one
is closed as no longer found.
Findings are tied to the code they flag, not to its line number: the rule,
the file, the flagged line without its whitespace (for a secret, the match),
and how many identical lines come before it in the file. When code moves
(lines added above it, re-indented), the finding stays the same: its status,
assessment and tracker issue stay with it, and it shows the new line. Only
a change of the flagged line itself (or a rename of the file) makes it a new
finding and closes the old one. Findings stored before this was introduced
keep their status and issue on the first scan after it.
### Recommended Flow
@@ -18,6 +18,7 @@ together on stage in one pass before the next prod promotion.
| #465 | Malware stage (ClamAV), committed binaries, unchanged scheduled rescans skipped |
| #461 | Transitive NuGet packages of `<PackageReference>` projects resolved from nuget.org |
| #467 (follow-up) | npm and Maven licenses from their public registries |
| #491 | Findings keyed by the code they flag, not its line number |
**Customer-visible on the next prod rescan** is marked **[visible]**: these
change what a customer sees on their existing targets, without them doing
@@ -305,6 +306,31 @@ Unchanged rescans:
- **[visible]** npm and Maven components gain licenses in the SBOM and the
**Lizenzen** tab (and copyleft warnings where they apply).
### 18. #491 Content-based fingerprints
Findings that existed before this deploy must keep their rows; check on a
target with history (findings, at least one marked by a person, issues).
- **Do:** note a target's findings (ids, statuses, tracker issues), deploy,
start **Prüfung starten** without changing the code.
- **Expect:** no new findings, nothing closed, every status, assessment and
issue as before.
- **Log:** `findings stored under a line-based fingerprint now keyed by their
content` with `adopted=<count of that target's line-based findings>` (once;
the next scan logs nothing).
- **Do:** in a git target, add a few lines at the top of a file with a finding
(or re-indent the flagged line) and push.
- **Expect:** the finding keeps its id, status and issue and shows the new line;
no "Bei der Prüfung nicht mehr gefunden" comment on its issue, no new issue.
- **Log:** `findings whose code moved now point at their new line` with
`moved=…`.
- **Do:** duplicate a flagged line in the same file.
- **Expect:** two findings (the copy is a new one).
- **[visible]** on prod after promotion: the first rescan of every target re-keys
its findings without changing anything visible; afterwards, edits above a
finding no longer close and reopen it and its issue. A change to the flagged
line itself still does.
## After the pass
- The nightly job on `main` is green with the new mobile targets.