feat(scans): show sub-steps of "Projekt erkennen" and clone once per scan #421

Merged
sharang merged 1 commits from feat/scan-substeps into main 2026-09-28 21:40:00 +00:00
Owner

Why

The FreeRTOS iot-reference rescan on staging sat on "Projekt erkennen" for about 10 minutes with no visible progress. The infra logs showed two problems:

  • The long part is the 30-submodule fetch, and nothing tells the user about it.
  • Stage 0 cloned the repository and its submodules a second time, under the target's name. That's about 10 GB and 20 minutes per run.

What

  • Sub-steps: ScanRun.current_step (clone_repository, fetch_submodules, unpack_archive, detect_project_type, analyse_firmware) is shown as "Projekt erkennen · Submodule holen" in the run header and the stepper. update_phase clears it.
  • Ingest off the async executor: ingest now runs in spawn_blocking and reports its steps over a channel.
  • One clone per scan: RepoView.checkout = the code artifact id, where ingest clones. Stage 0, the commit watermark, the graph file viewer, chat and PR review all use it.

After deploy

Old repos/<tenant>/<target name> checkouts on stage are stale. Retention still removes them when a target is deleted.

Tests

  • core: optional current_step round trip
  • ingest: archive unpacking reported as a step
  • repo view: checkout matches the artifact id
  • dashboard: step texts
  • clippy with the CI flags on core, agent, dashboard (server and web) and mcp; fmt

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

## Why The FreeRTOS iot-reference rescan on staging sat on "Projekt erkennen" for about 10 minutes with no visible progress. The infra logs showed two problems: - The long part is the 30-submodule fetch, and nothing tells the user about it. - Stage 0 cloned the repository and its submodules **a second time**, under the target's name. That's about 10 GB and 20 minutes per run. ## What - **Sub-steps:** `ScanRun.current_step` (`clone_repository`, `fetch_submodules`, `unpack_archive`, `detect_project_type`, `analyse_firmware`) is shown as "Projekt erkennen · Submodule holen" in the run header and the stepper. `update_phase` clears it. - **Ingest off the async executor:** ingest now runs in `spawn_blocking` and reports its steps over a channel. - **One clone per scan:** `RepoView.checkout` = the code artifact id, where ingest clones. Stage 0, the commit watermark, the graph file viewer, chat and PR review all use it. ## After deploy Old `repos/<tenant>/<target name>` checkouts on stage are stale. Retention still removes them when a target is deleted. ## Tests - core: optional `current_step` round trip - ingest: archive unpacking reported as a step - repo view: `checkout` matches the artifact id - dashboard: step texts - clippy with the CI flags on core, agent, dashboard (server and web) and mcp; fmt 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-28 21:32:58 +00:00
feat(scans): show sub-steps of "Projekt erkennen" and clone once per scan
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 6m53s
b632732924
A repository with many submodules sat on "Projekt erkennen" for ten
minutes with no sign of progress, and Stage 0 then cloned it a second
time under the target's name (about 10 GB and 20 minutes per run for
the FreeRTOS STM32U5 reference).

- ScanRun.current_step records the step inside the phase: cloning,
  submodules, unpacking, project type, firmware analysis. The dashboard
  shows it next to the phase and in the stepper; a phase change clears it.
- Ingest runs in spawn_blocking and reports its steps over a channel,
  so a long clone no longer blocks an async worker.
- Every reader of a git target's checkout (Stage 0, commit watermark,
  graph file viewer, chat, PR review) uses the artifact-id directory
  ingest clones into, so the repository is fetched once per scan.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang merged commit fce9edfbeb into main 2026-09-28 21:40:00 +00:00
Sign in to join this conversation.