fix(scan): findings in test data and excluded paths close, whichever scanner stored them #904

Merged
sharang merged 1 commits from fix/left-out-findings-resolve into main 2026-11-05 17:56:01 +00:00
Owner

Problem

Since #820 and #825, test data and excluded paths leave the working copy before any stage runs. After the last complete prod scan of our own repository, 10 issues on fixtures/nightly/... were still open, and the scan opened one more (#885). There are two causes:

  1. A scanner that does not run cannot close its findings. cppcheck runs only on a tree with C, and the recipe lint (oelint-adv, yocto-config) only on one with BitBake. The fixtures held the tree's only C and BitBake. With them removed, neither scanner ran, and resolve_missing only closes findings of scanners that completed. That left #842–844 (cppcheck) and #865–868 (recipe lint) open.
  2. gitleaks walks the git history, where the removed files still are. It reported their secrets again on every run, so resolve_missing kept them open, and the issue catch-up opened #885 for fixtures/nightly/archive/config/service.env. This also kept #879 and #880 open. Its own allowlist matches /fixtures/ only below the root.

Change

  • RunFindings::resolve_left_out takes Option<&str> for the scanner. None covers every scanner, and the PLC stage still passes its own. The code scan calls it with None after resolve_missing, so a finding an earlier scan stored in a left-out path closes as test data or excluded, whichever scanner stored it.
  • resolve_left_out keeps a finding this run reported again, as resolve_missing does, so nothing is closed only to reopen on the next run.
  • The orchestrator filters findings in the left-out paths out of the code findings, as it does vendor code. This covers gitleaks's history walk, and the same holds for paths a target excludes in its settings.

Tests

tests/resolve_findings.rs: a new Mongo-backed test. Findings of scanners that did not run (cppcheck, yocto-config) in test data and in an excluded path close with their reason. One this run reported again stays open, as does one outside the left-out paths. The PLC test is updated for the new signature.

After deploy

The next complete scan of the target closes the 10 issues, and the left-out paths open no new ones.

🤖 Generated with Claude Code

## Problem Since #820 and #825, test data and excluded paths leave the working copy before any stage runs. After the last complete prod scan of our own repository, 10 issues on `fixtures/nightly/...` were still open, and the scan opened one more (#885). There are two causes: 1. **A scanner that does not run cannot close its findings.** cppcheck runs only on a tree with C, and the recipe lint (oelint-adv, yocto-config) only on one with BitBake. The fixtures held the tree's only C and BitBake. With them removed, neither scanner ran, and `resolve_missing` only closes findings of scanners that completed. That left #842–844 (cppcheck) and #865–868 (recipe lint) open. 2. **gitleaks walks the git history**, where the removed files still are. It reported their secrets again on every run, so `resolve_missing` kept them open, and the issue catch-up opened #885 for `fixtures/nightly/archive/config/service.env`. This also kept #879 and #880 open. Its own allowlist matches `/fixtures/` only below the root. ## Change - `RunFindings::resolve_left_out` takes `Option<&str>` for the scanner. `None` covers every scanner, and the PLC stage still passes its own. The code scan calls it with `None` after `resolve_missing`, so a finding an earlier scan stored in a left-out path closes as *test data* or *excluded*, whichever scanner stored it. - `resolve_left_out` keeps a finding this run reported again, as `resolve_missing` does, so nothing is closed only to reopen on the next run. - The orchestrator filters findings in the left-out paths out of the code findings, as it does vendor code. This covers gitleaks's history walk, and the same holds for paths a target excludes in its settings. ## Tests `tests/resolve_findings.rs`: a new Mongo-backed test. Findings of scanners that did not run (cppcheck, yocto-config) in test data and in an excluded path close with their reason. One this run reported again stays open, as does one outside the left-out paths. The PLC test is updated for the new signature. ## After deploy The next complete scan of the target closes the 10 issues, and the left-out paths open no new ones. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-11-05 17:38:51 +00:00
fix(scan): findings in test data and excluded paths close, whichever scanner stored them
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m24s
CI / Check (pull_request) Successful in 16m52s
7324bb295e
Test data and excluded paths leave the working copy before any stage runs,
but two things kept their findings open:

- A scanner that does not run cannot close its findings. cppcheck runs
  only on a tree with C and the recipe lint only on one with BitBake, so
  once a fixture held the tree's only C or BitBake, resolve_missing never
  saw those scanners complete. resolve_left_out now covers every scanner
  (the PLC stage still passes its own) and runs after resolve_missing.
- gitleaks walks the git history, where the removed files still are, so
  it reported their secrets again on every run. They were kept open, and
  the issue catch-up opened new issues for them. The left-out paths are now
  filtered from the code findings like vendor code.

resolve_left_out keeps a finding this run reported again, as
resolve_missing does, so nothing is closed only to reopen on the next run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit b079cf9267 into main 2026-11-05 17:56:01 +00:00
Sign in to join this conversation.