fix(onboarding): a scan the target runs is listed once among its applicable scans (#1043) #1046

Merged
sharang merged 1 commits from fix/applicable-scans-once into main 2026-11-17 16:46:33 +00:00
Owner

Fixes #1043, found while testing supplier SBOMs on stage (#1025).

Cause

A scan has one rule in the scan matrix for each artifact it can read: code, a firmware image, a supplier SBOM. GET /api/v1/targets/{id}/applicable-scans listed every rule. On a firmware target with only a supplier SBOM, the wizard and the target page therefore showed "Stückliste" and "Bekannte Schwachstelle (CVE)" three times each:

  • blocked, "braucht Quellcode";
  • blocked, "Firmware-Images werden noch nicht entpackt";
  • running, from the supplier SBOM.

That reads as if the SBOM weren't used.

What

  • The endpoint lists a scan the target runs once, as running. The rules that would need another artifact are left out for it.
  • A scan nothing runs keeps every reason why not, as before.
  • The scan plan is unchanged. build_scan_plan still binds each rule to its artifact; only the list the dashboard shows changes.

Tests

  • Unit: a running scan is listed once and a blocked scan keeps its reason; a scan that runs nowhere keeps both reasons.
  • Integration: the supplier SBOM test now also checks that SBOM and CVE each appear exactly once.
  • Local runs: the agent test suite is green, and clippy --all-targets -D warnings is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Fixes #1043, found while testing supplier SBOMs on stage (#1025). ## Cause A scan has one rule in the scan matrix for each artifact it can read: code, a firmware image, a supplier SBOM. `GET /api/v1/targets/{id}/applicable-scans` listed every rule. On a firmware target with only a supplier SBOM, the wizard and the target page therefore showed "Stückliste" and "Bekannte Schwachstelle (CVE)" three times each: - blocked, "braucht Quellcode"; - blocked, "Firmware-Images werden noch nicht entpackt"; - running, from the supplier SBOM. That reads as if the SBOM weren't used. ## What - **The endpoint lists a scan the target runs once**, as running. The rules that would need another artifact are left out for it. - **A scan nothing runs** keeps every reason why not, as before. - **The scan plan is unchanged.** `build_scan_plan` still binds each rule to its artifact; only the list the dashboard shows changes. ## Tests - **Unit:** a running scan is listed once and a blocked scan keeps its reason; a scan that runs nowhere keeps both reasons. - **Integration:** the supplier SBOM test now also checks that SBOM and CVE each appear exactly once. - **Local runs:** the agent test suite is green, and clippy `--all-targets -D warnings` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-17 13:06:57 +00:00
fix(onboarding): a scan the target runs is listed once among its applicable scans (#1043)
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 5m12s
CI / Check (pull_request) Successful in 21m51s
4ff2c19926
A scan has one rule per artifact it can read; the endpoint listed each,
so a target with only a supplier SBOM showed its SBOM and CVE scans
three times, twice as blocked ('braucht Quellcode', 'Firmware-Images
werden noch nicht entpackt'). Once one rule runs a scan, the endpoint now
lists it once, as running; a scan none runs keeps every reason why not.
The scan plan still binds each rule to its artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit 31b8cb9d37 into main 2026-11-17 16:46:33 +00:00
sharang deleted branch fix/applicable-scans-once 2026-11-17 16:46:33 +00:00
Sign in to join this conversation.