feat(releases): the next version's draft and each version's customers (#1028) #1066

Merged
sharang merged 3 commits from feat/sbom-version-draft into main 2026-11-19 17:36:23 +00:00
Owner

Part of #1028. It covers what the supplier's release screen needs from the API (mockup RL3h, board "Prüfwerk, Zulieferer: Freigaben eines Prüfobjekts"). The screen itself follows in a stacked PR.

Draft

GET /api/v1/targets/{id}/versions/draft describes the next version without storing anything. It returns:

  • components: how many components the version would list.
  • scanned_at: when the scan it comes from finished.
  • changes: what it adds, updates and removes compared with the latest published version, with up to 3 names each. This reuses component_changes::diff over both released documents, and added + updated + unchanged always equals components.
  • blocked: why the version cannot be published (empty, too_many_components). This comes back as a 200 so the screen can show it, not as an error.

When there is no earlier version, or its document can't be read, changes is null.

Customers per version

deliver() records each release a version reached ($addToSet). This also counts acceptances that happen after publishing. The list shows the count as customers.

Two fixes found while checking the screen

  • A released SBOM no longer passes on addresses. Yocto pkg:generic purls carry download_url / vcs_url qualifiers, which can name the supplier's own git server or feed. The released document (from #1049) passed them on in purl and bom-ref. They are now removed, along with repository_url; other qualifiers and the subpath stay. A bom-ref that becomes a duplicate gets " (2)" appended.
  • A 404 from the registry for a tenant's connections now lists none. Before tenant-registry#138 the registry has no such route, and the screen would otherwise warn on every visit that connections cannot be read. Other errors still answer 503.

Tests

  • Unit tests: the count invariant, including two copies of one package, and an unchanged version.
  • Integration tests (connections.rs): customers 1, 1 and then 0 after the release ends; a draft against 1.6.0; a draft without components that comes back blocked.
  • Unit tests for the address strip and for unique bom-refs; an integration test for the 404.
  • Clippy 1.94 is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part of #1028. It covers what the supplier's release screen needs from the API (mockup RL3h, board "Prüfwerk, Zulieferer: Freigaben eines Prüfobjekts"). The screen itself follows in a stacked PR. **Draft** `GET /api/v1/targets/{id}/versions/draft` describes the next version without storing anything. It returns: - `components`: how many components the version would list. - `scanned_at`: when the scan it comes from finished. - `changes`: what it adds, updates and removes compared with the latest published version, with up to 3 names each. This reuses `component_changes::diff` over both released documents, and `added + updated + unchanged` always equals `components`. - `blocked`: why the version cannot be published (`empty`, `too_many_components`). This comes back as a 200 so the screen can show it, not as an error. When there is no earlier version, or its document can't be read, `changes` is null. **Customers per version** `deliver()` records each release a version reached (`$addToSet`). This also counts acceptances that happen after publishing. The list shows the count as `customers`. **Two fixes found while checking the screen** - **A released SBOM no longer passes on addresses.** Yocto `pkg:generic` purls carry `download_url` / `vcs_url` qualifiers, which can name the supplier's own git server or feed. The released document (from #1049) passed them on in `purl` and `bom-ref`. They are now removed, along with `repository_url`; other qualifiers and the subpath stay. A `bom-ref` that becomes a duplicate gets " (2)" appended. - **A 404 from the registry for a tenant's connections now lists none.** Before tenant-registry#138 the registry has no such route, and the screen would otherwise warn on every visit that connections cannot be read. Other errors still answer 503. **Tests** - Unit tests: the count invariant, including two copies of one package, and an unchanged version. - Integration tests (`connections.rs`): customers 1, 1 and then 0 after the release ends; a draft against 1.6.0; a draft without components that comes back blocked. - Unit tests for the address strip and for unique `bom-ref`s; an integration test for the 404. - Clippy 1.94 is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-19 16:34:18 +00:00
feat(releases): the next version's draft and each version's customers (#1028)
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 5m24s
CI / Check (pull_request) Successful in 21m25s
da13aab408
The supplier's release screen (mockup RL3h) shows what publishing now
would change and how many customers each version reached; neither was
in the API.

- GET /api/v1/targets/{id}/versions/draft: the next version's component
  count, the scan it comes from, and its additions, updates and removals
  against the latest published version (component_changes::diff over
  both released documents), with a few names. A target that cannot be
  published answers 200 with `blocked` (empty, too_many_components).
- Each version records the releases it was delivered over
  ($addToSet in deliver(), so acceptances after publishing count too);
  the list shows the count as `customers`.
- released_entries split out of released_document; the refusal codes
  are an enum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-19 17:02:16 +00:00
fix(registry): a 404 for a tenant's connections lists none (#1028)
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) Canceled after 2m53s
CI / Agent integration (pull_request) Canceled after 2m54s
b05154adce
Before tenant-registry#138 the registry has no connections route; the
release screen would warn on every visit that connections cannot be
read. A 404 now lists no connections; other errors still answer 503.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-19 17:05:09 +00:00
fix(sbom): a released SBOM's purls name no download or VCS address (#1028)
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 5m25s
CI / Check (pull_request) Successful in 21m49s
1ca85ca859
Yocto recipes give pkg:generic purls a download_url or vcs_url
qualifier, which can name the supplier's own git server or feed. The
released document passed them on in purl and bom-ref. They are now left
out (download_url, vcs_url, repository_url); other qualifiers and the
subpath stay. A bom-ref that becomes a duplicate gets " (2)" appended.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit d3500d4be4 into main 2026-11-19 17:36:23 +00:00
sharang deleted branch feat/sbom-version-draft 2026-11-19 17:36:23 +00:00
Sign in to join this conversation.