feat(dashboard): scan status and history on the targets page #343

Merged
sharang merged 1 commits from feat/scan-run-view into main 2026-09-23 13:55:02 +00:00
Owner

Part of #284 and the pilot P0 (#338), item E (scan runs). Stacked on #342, which is its base; it retargets to main after #342 merges.

Why

A customer could start a scan but never see whether it ran, which step it was at, why it failed, or which stages it left out. The dashboard's fetch_scan_runs was never used.

What

Agent

  • GET /api/v1/scan-runs?target_id=<id> lists one target's runs. Without the parameter it lists all, as before.
  • GET /api/v1/targets: each item gains last_scan (the newest ScanRun, or null), fetched for the whole page with one aggregation. The field is additive, so existing clients are unaffected.

Dashboard

  • Targets list:
    • a "Letzte Prüfung / Last scan" column shows the status badge, plus the current step while a scan runs;
    • the findings count links to /findings?target=<id>, the findings list pre-filtered to that target;
    • "Run scan" refreshes the list.
  • Target details: scan history, newest 10:
    • status, start and finish (dd.mm.yyyy in German);
    • new findings;
    • the error of a failed run, and a hint for an interrupted one;
    • every stage that was not run, with its reason.
    • It re-fetches every 5 s while a run is running. Only the browser polls.
  • i18n:
    • the targets page is fully German/English;
    • target types and artifact kinds are shared label tables (i18n::texts::kinds);
    • phase names are an exhaustive match over ScanPhase, so a new phase needs both translations to compile.
    • Stage ids from #339/#340 (sast, sast_c_cpp, sast_vendor_code, ingest) already have labels. Unknown ids show as they are.
    • Skip reasons stay as the agent writes them (English) for now.

Verification

  • Unit tests:
    • scan-run filter document;
    • date format per language;
    • stage-label fallback.
    • All 33 dashboard lib tests pass.
  • clippy with the CI flags: agent; dashboard server and web. fmt.
  • Not yet seen in a browser. Staging check: expand a target during a scan and watch the step change; a failed upload shows its error; the findings link filters.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Part of #284 and the pilot P0 (#338), item E (scan runs). **Stacked on #342**, which is its base; it retargets to `main` after #342 merges. ## Why A customer could start a scan but never see whether it ran, which step it was at, why it failed, or which stages it left out. The dashboard's `fetch_scan_runs` was never used. ## What **Agent** - `GET /api/v1/scan-runs?target_id=<id>` lists one target's runs. Without the parameter it lists all, as before. - `GET /api/v1/targets`: each item gains `last_scan` (the newest `ScanRun`, or `null`), fetched for the whole page with one aggregation. The field is additive, so existing clients are unaffected. **Dashboard** - **Targets list:** - a "Letzte Prüfung / Last scan" column shows the status badge, plus the current step while a scan runs; - the findings count links to `/findings?target=<id>`, the findings list pre-filtered to that target; - "Run scan" refreshes the list. - **Target details:** scan history, newest 10: - status, start and finish (dd.mm.yyyy in German); - new findings; - the error of a failed run, and a hint for an interrupted one; - every stage that was not run, with its reason. - It re-fetches every 5 s while a run is `running`. Only the browser polls. - **i18n:** - the targets page is fully German/English; - target types and artifact kinds are shared label tables (`i18n::texts::kinds`); - phase names are an exhaustive `match` over `ScanPhase`, so a new phase needs both translations to compile. - Stage ids from #339/#340 (`sast`, `sast_c_cpp`, `sast_vendor_code`, `ingest`) already have labels. Unknown ids show as they are. - Skip reasons stay as the agent writes them (English) for now. ## Verification - Unit tests: - scan-run filter document; - date format per language; - stage-label fallback. - All 33 dashboard lib tests pass. - clippy with the CI flags: agent; dashboard `server` and `web`. fmt. - **Not yet seen in a browser.** Staging check: expand a target during a scan and watch the step change; a failed upload shows its error; the findings link filters. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang changed target branch from feat/dashboard-i18n to main 2026-09-23 13:46:21 +00:00
sharang added 1 commit 2026-09-23 13:46:21 +00:00
feat(dashboard): scan status and history on the targets page (#284)
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 / Check (pull_request) Successful in 7m45s
466ff01283
A customer could start a scan but never see whether it ran, where it was,
why it failed or which stages it left out: fetch_scan_runs was unused.

- Agent: GET /api/v1/scan-runs takes ?target_id=; GET /api/v1/targets
  adds each target's newest run as `last_scan` (one aggregation).
- Targets list: a "last scan" column (status, and the step a running
  scan is at); the findings count links to the findings list filtered to
  that target (/findings?target=<id>); starting a scan refreshes the list.
- Target details: the scan history, newest first, with start and finish
  times, new findings, the error of a failed run, and each stage that was
  not run with its reason. It refreshes every 5 s while a scan runs.
- The targets page is in German and English; target types and artifact
  kinds are shared label tables. Phase names are an exhaustive match, so
  a new phase does not compile without both translations.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang force-pushed feat/scan-run-view from a96519bfc7 to 466ff01283 2026-09-23 13:46:22 +00:00 Compare
sharang merged commit 52359d1786 into main 2026-09-23 13:55:02 +00:00
Sign in to join this conversation.