feat(delivery): published SBOM versions reach the customers who accepted (#1028) #1065

Merged
sharang merged 1 commits from feat/sbom-delivery into main 2026-11-19 16:21:44 +00:00
Owner

Part of #1028 (phase 4), step 5, second half: delivering published versions. Based on main (#1064 is merged).

What it does

  • When versions are delivered:
    • On publish: POST /api/v1/targets/{id}/versions delivers the new version to every active release of the target that the customer accepted.
    • On accept: POST /api/v1/sbom-offers/{id}/accept delivers the supplier's latest published version straight away, if there is one.
  • Connection check: before each write into the customer's workspace, the registry is asked again whether the connection joins exactly these two workspaces (ConnectionState::peer_of). Nothing arrives after the connection or the release has ended.
  • Same path as an upload: a delivery goes through onboarding::attach_upload like an invite upload. It replaces the component's supplier SBOM (one at a time, #1025), sets the component's supplier version to the label, and starts a scan (ScanTrigger::NewContent).
  • No duplicates: the offer records the content hash, label and time of its last delivery. If an acceptance and a publication race, the same content is still delivered only once.
  • Who sees what: the customer sees delivered_label and delivered_at on the offer; the supplier sees the same two fields on the release.
  • Failures: a delivery that fails is logged and doesn't fail the publication. The next version tries again.
  • Docs: guide/sbom.

Tests (tests/connections.rs, fake registry)

accepted_releases_receive_each_published_version:

  • a version published before acceptance arrives on accepting: the offer shows 1.4.0, the component has one supplier SBOM, and its supplier version is 1.4.0;
  • a version published afterwards arrives at once: there is still exactly one supplier SBOM, now 1.5.0, and both the customer's offer and the supplier's release show it;
  • after the release ends, a new version (1.6.0) doesn't arrive.

The other 8 connection, release and offer tests pass. The OpenAPI, route and role gates pass, and the e2e releases, onboarding, cascade and supplier tests pass. cargo +1.94 clippy (the CI toolchain) is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Part of #1028 (phase 4), step 5, second half: delivering published versions. Based on `main` (#1064 is merged). ## What it does - **When versions are delivered:** - **On publish:** `POST /api/v1/targets/{id}/versions` delivers the new version to every active release of the target that the customer accepted. - **On accept:** `POST /api/v1/sbom-offers/{id}/accept` delivers the supplier's latest published version straight away, if there is one. - **Connection check:** before each write into the customer's workspace, the registry is asked again whether the connection joins exactly these two workspaces (`ConnectionState::peer_of`). Nothing arrives after the connection or the release has ended. - **Same path as an upload:** a delivery goes through `onboarding::attach_upload` like an invite upload. It replaces the component's supplier SBOM (one at a time, #1025), sets the component's supplier version to the label, and starts a scan (`ScanTrigger::NewContent`). - **No duplicates:** the offer records the content hash, label and time of its last delivery. If an acceptance and a publication race, the same content is still delivered only once. - **Who sees what:** the customer sees `delivered_label` and `delivered_at` on the offer; the supplier sees the same two fields on the release. - **Failures:** a delivery that fails is logged and doesn't fail the publication. The next version tries again. - **Docs:** `guide/sbom`. ## Tests (`tests/connections.rs`, fake registry) `accepted_releases_receive_each_published_version`: - a version published before acceptance arrives on accepting: the offer shows `1.4.0`, the component has one supplier SBOM, and its supplier version is `1.4.0`; - a version published afterwards arrives at once: there is still exactly one supplier SBOM, now `1.5.0`, and both the customer's offer and the supplier's release show it; - after the release ends, a new version (`1.6.0`) doesn't arrive. The other 8 connection, release and offer tests pass. The OpenAPI, route and role gates pass, and the e2e releases, onboarding, cascade and supplier tests pass. `cargo +1.94 clippy` (the CI toolchain) is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang changed target branch from feat/sbom-offers to main 2026-11-19 13:10:20 +00:00
sharang added 1 commit 2026-11-19 13:10:23 +00:00
feat(delivery): published SBOM versions reach the customers who accepted (#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 5m46s
CI / Check (pull_request) Successful in 22m2s
ae6b56f104
The second half of phase 4's customer side (step 5 of the plan on #1028):

- publishing a version delivers it to every accepted, active release of the
  target; accepting an offer delivers the latest version at once;
- the connection is asked again right before each write into the customer's
  workspace (`ConnectionState::peer_of`), so nothing arrives after it or
  the release ended;
- a delivery is attached the way a supplier's upload is (`attach_upload`):
  it replaces the component's supplier SBOM, sets the supplier version to
  the label, and starts a scan;
- the offer keeps the content hash, label and time last delivered, so the
  same content is never delivered twice (an acceptance and a publication
  that race); the supplier's release shows the label and time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang force-pushed feat/sbom-delivery from 79826847bf to ae6b56f104 2026-11-19 13:10:23 +00:00 Compare
sharang merged commit 9da4d83ed0 into main 2026-11-19 16:21:44 +00:00
sharang deleted branch feat/sbom-delivery 2026-11-19 16:21:45 +00:00
Sign in to join this conversation.