You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ar...@apache.org on 2026/08/25 11:12:18 UTC
(tooling-trusted-releases) branch arm updated: Update CLE PURL again
This is an automated email from the ASF dual-hosted git repository.
alitheg pushed a commit to branch arm
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/arm by this push:
new 20ec1413 Update CLE PURL again
20ec1413 is described below
commit 20ec141323cfb9e987eda98a40a25ed597ede7c1
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Tue Aug 25 12:11:54 2026 +0100
Update CLE PURL again
---
atr/cle.py | 4 +++-
tests/unit/test_cle.py | 11 +++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/atr/cle.py b/atr/cle.py
index b54660f0..33afe71e 100644
--- a/atr/cle.py
+++ b/atr/cle.py
@@ -45,6 +45,7 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Any, Final
+import atr.config as config
import atr.models.cle as cle
import atr.models.sql as sql
@@ -172,7 +173,8 @@ def _identifier(project: sql.Project, release: sql.Release | None = None) -> str
(`pkg:maven/...`, `pkg:pypi/...`) belong on the artifact catalog (#911),
not on the lifecycle doc. This may change with outcome of https://github.com/package-url/purl-spec/issues/516
"""
- return f"pkg:scid/the+asf/{project.key}" + ("" if release is None else f"@{release.version}")
+ catalog_url = (config.get().RELEASE_CATALOG_URL or "").removeprefix("https://").removesuffix("/")
+ return f"pkg:scid/{catalog_url}/the+asf/{project.key}" + ("" if release is None else f"@{release.version}")
def _release_for(event: sql.LifecycleEvent, releases_by_key: dict[str, sql.Release]) -> sql.Release:
diff --git a/tests/unit/test_cle.py b/tests/unit/test_cle.py
index 3b5de728..a229aa15 100644
--- a/tests/unit/test_cle.py
+++ b/tests/unit/test_cle.py
@@ -21,13 +21,15 @@ from types import SimpleNamespace
import pytest
import atr.cle as cle
+import atr.config as config
import atr.models.cle as cle_lib
import atr.models.sql as sql
-def test_identifier_renders_apache_purl():
+def test_identifier_renders_apache_purl(monkeypatch):
+ monkeypatch.setattr(config.get(), "RELEASE_CATALOG_URL", "https://catalog.example.test/")
project = SimpleNamespace(key="myproject", committee_key="mycommittee")
- assert cle._identifier(project) == "pkg:scid/the+asf/myproject"
+ assert cle._identifier(project) == "pkg:scid/catalog.example.test/the+asf/myproject"
def test_project_document_emits_default_support_definition_when_eod_or_eos_present():
@@ -48,10 +50,11 @@ def test_project_document_emits_no_events_when_input_empty():
assert doc["events"] == []
-def test_project_document_emits_purl_identifier():
+def test_project_document_emits_purl_identifier(monkeypatch):
+ monkeypatch.setattr(config.get(), "RELEASE_CATALOG_URL", "https://catalog.example.test/")
project = SimpleNamespace(key="myproject", version_method=sql.VersionMethod.SIMPLE, committee_key="mycommittee")
doc = cle.project_document(project, [], [], now=datetime.datetime(2026, 7, 1, tzinfo=datetime.UTC))
- assert doc["identifier"] == "pkg:scid/the+asf/myproject"
+ assert doc["identifier"] == "pkg:scid/catalog.example.test/the+asf/myproject"
def test_project_document_emits_schema_url():
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org