fix: preserve legacy SBOM source values
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a028f0-a42f-7582-89a8-ebaad7343834
This commit is contained in:
parent
1e5222d458
commit
98518091ae
2 changed files with 13 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue