Part of #1028 (phase 4), step 4 of the plan on that issue: releases and publishing, the supplier's side. Stacked on #1062 (the connections client); it will be retargeted to main once that merges.
What it adds
Call
What it does
GET /api/v1/targets/{id}/releases
The target's releases (active ones first, each group newest first) and its published versions
POST /api/v1/targets/{id}/releases{connection_id}
Releases the target over one of the workspace's active connections. 409 released if it's already released over it; 422 unknown_connection otherwise.
POST …/releases/{release}/end
Ends a release. Ending it again keeps the first end.
POST /api/v1/targets/{id}/versions{label}
Publishes a version: the target's components now, as the stripped CycloneDX from #1049, with the workspace's display name as supplier and the label as version. 409 label_taken, 422 empty, 422 label, 413 too_many_components.
GET …/versions/preview?label=
The same document, as a download, without publishing it
Storage: releases go in sbom_releases and versions in sbom_versions, both in the supplier's own database.
A version's document is kept in the target's upload folder together with its SHA-256. The customer side will use the hash so an unchanged version starts no scan.
A release keeps the other workspace's display name from when it was made. It never holds or shows the other tenant's id.
Audit: releasing, ending and publishing are recorded through the registry (pruefwerk.sbom_release_created, …_ended, pruefwerk.sbom_version_published).
Deleting a target deletes its releases and versions; their files go with its upload folder, as before.
Docs:guide/sbom, section "Releasing an SBOM to a connected workspace".
Delivering versions to the customers who accept comes with the customer side (step 5).
Tests
Unit: label rules; a release reads as active until it is ended.
e2e, without a registry:
nothing to publish before there are components;
publishing trims the label and counts the components; a duplicate label and an empty label are refused;
the stored document is the stripped one: no vulnerabilities, and the CVE appears nowhere in it;
a preview stores nothing;
releasing without a registry gives 422 unknown_connection;
an unknown target gives 404.
Against the fake registry (tests/connections.rs):
a release over an active connection names the other workspace and never its tenant id;
a duplicate gives 409 and an unknown connection 422;
ending keeps the first end, and a target can be released again after its release ended;
another workspace gets 404 on this target.
Checks: the OpenAPI and route gates pass, the cascade tests pass, and clippy is clean.
Part of #1028 (phase 4), step 4 of the plan on that issue: releases and publishing, the supplier's side. **Stacked on #1062** (the connections client); it will be retargeted to `main` once that merges.
## What it adds
| Call | What it does |
|---|---|
| `GET /api/v1/targets/{id}/releases` | The target's releases (active ones first, each group newest first) and its published versions |
| `POST /api/v1/targets/{id}/releases` `{connection_id}` | Releases the target over one of the workspace's active connections. `409 released` if it's already released over it; `422 unknown_connection` otherwise. |
| `POST …/releases/{release}/end` | Ends a release. Ending it again keeps the first end. |
| `POST /api/v1/targets/{id}/versions` `{label}` | Publishes a version: the target's components now, as the stripped CycloneDX from #1049, with the workspace's display name as supplier and the label as version. `409 label_taken`, `422 empty`, `422 label`, `413 too_many_components`. |
| `GET …/versions/preview?label=` | The same document, as a download, without publishing it |
- **Storage:** releases go in `sbom_releases` and versions in `sbom_versions`, both in the supplier's own database.
- A version's document is kept in the target's upload folder together with its SHA-256. The customer side will use the hash so an unchanged version starts no scan.
- A release keeps the other workspace's display name from when it was made. It never holds or shows the other tenant's id.
- **Audit:** releasing, ending and publishing are recorded through the registry (`pruefwerk.sbom_release_created`, `…_ended`, `pruefwerk.sbom_version_published`).
- **Deleting a target** deletes its releases and versions; their files go with its upload folder, as before.
- **Docs:** `guide/sbom`, section "Releasing an SBOM to a connected workspace".
Delivering versions to the customers who accept comes with the customer side (step 5).
## Tests
- **Unit:** label rules; a release reads as active until it is ended.
- **e2e, without a registry:**
- nothing to publish before there are components;
- publishing trims the label and counts the components; a duplicate label and an empty label are refused;
- the stored document is the stripped one: no `vulnerabilities`, and the CVE appears nowhere in it;
- a preview stores nothing;
- releasing without a registry gives `422 unknown_connection`;
- an unknown target gives `404`.
- **Against the fake registry (`tests/connections.rs`):**
- a release over an active connection names the other workspace and never its tenant id;
- a duplicate gives `409` and an unknown connection `422`;
- ending keeps the first end, and a target can be released again after its release ended;
- another workspace gets `404` on this target.
- **Checks:** the OpenAPI and route gates pass, the cascade tests pass, and clippy is clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang
changed target branch from feat/registry-connections to main2026-11-19 12:12:02 +00:00
The supplier's side of phase 4, step 4 of the plan on #1028:
- `POST /api/v1/targets/{id}/releases` releases a target over one of the
workspace's active connections (#1062), once per connection at a time
(409 `released`); an unknown or inactive connection is 422
(`unknown_connection`); `…/releases/{release}/end` ends it (idempotent);
- `POST /api/v1/targets/{id}/versions` publishes a version: the target's
components now as the stripped CycloneDX (`released_cyclonedx`, #1049),
the workspace's display name as supplier and the label as version; labels
are unique per target (409), a target without components is 422; the
document is kept in the target's upload folder with its SHA-256, so an
unchanged version is never delivered twice;
- `GET …/versions/preview?label=` builds it without storing it;
- `GET /api/v1/targets/{id}/releases` lists releases (active first) and
versions;
- releasing, ending and publishing are audited; deleting a target deletes
its releases and versions (their files with its upload folder).
Delivering versions to the customers who accept comes with the customer
side.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #1028 (phase 4), step 4 of the plan on that issue: releases and publishing, the supplier's side. Stacked on #1062 (the connections client); it will be retargeted to
mainonce that merges.What it adds
GET /api/v1/targets/{id}/releasesPOST /api/v1/targets/{id}/releases{connection_id}409 releasedif it's already released over it;422 unknown_connectionotherwise.POST …/releases/{release}/endPOST /api/v1/targets/{id}/versions{label}409 label_taken,422 empty,422 label,413 too_many_components.GET …/versions/preview?label=sbom_releasesand versions insbom_versions, both in the supplier's own database.pruefwerk.sbom_release_created,…_ended,pruefwerk.sbom_version_published).guide/sbom, section "Releasing an SBOM to a connected workspace".Delivering versions to the customers who accept comes with the customer side (step 5).
Tests
vulnerabilities, and the CVE appears nowhere in it;422 unknown_connection;404.tests/connections.rs):409and an unknown connection422;404on this target.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
a2f768d99ctob84c6d329e