fix: preserve legacy SBOM source values
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 36s

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a028f0-a42f-7582-89a8-ebaad7343834
This commit is contained in:
tegwick 2026-08-22 19:08:10 +02:00
parent 1e5222d458
commit 98518091ae
2 changed files with 13 additions and 2 deletions

View file

@ -343,7 +343,15 @@ async def _translate_snapshots(
def _translate_snapshot(item: dict, repo_id: uuid.UUID) -> dict:
return {**item, "repo_id": repo_id}
translated = {**item, "repo_id": repo_id}
source = translated.get("source")
if (
translated.get("legacy_id")
and isinstance(source, str)
and source.startswith("state-hub:")
):
translated["source"] = source.removeprefix("state-hub:")
return translated
def _translate_entry(item: dict, repo_id: uuid.UUID) -> dict: