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/07/15 08:26:19 UTC

(tooling-trusted-releases) branch arm updated: Replace dist/atr on non-live environments properly

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 6f2da7f7 Replace dist/atr on non-live environments properly
6f2da7f7 is described below

commit 6f2da7f7a2658bda5119f3d89f3aef8cee4014b4
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Wed Jul 15 09:25:44 2026 +0100

    Replace dist/atr on non-live environments properly
---
 atr/construct.py      |  5 ++---
 atr/shared/catalog.py | 24 ++++++++++++++++--------
 atr/util.py           |  9 +++++++++
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/atr/construct.py b/atr/construct.py
index 16539e7e..20417c14 100644
--- a/atr/construct.py
+++ b/atr/construct.py
@@ -244,6 +244,7 @@ async def announce_release_subject_and_body(
         "YOUR_ASF_ID": options.asfuid,
         "YOUR_FULL_NAME": options.fullname,
     }
+    values["DOWNLOAD_URL"] = util.released_dist_url(values["DOWNLOAD_URL"])
     subject = _substitute(subject, values, "announce_subject")
     body = _substitute(body, values, "announce")
     return subject, body
@@ -436,9 +437,7 @@ async def start_vote_subject_and_body(subject: str, body: str, options: StartVot
         "YOUR_ASF_ID": options.asfuid,
         "YOUR_FULL_NAME": options.fullname,
     }
-    # Temporary fix for alpha:
-    if "dist/atr" in body_values["KEYS_FILE"]:
-        body_values["KEYS_FILE"] = body_values["KEYS_FILE"].replace("dist/atr", "dist/release")
+    body_values["KEYS_FILE"] = util.released_dist_url(body_values["KEYS_FILE"])
     subject = _substitute(subject, subject_values, "vote_subject")
     body = _substitute(body, body_values, "vote")
     return subject, body
diff --git a/atr/shared/catalog.py b/atr/shared/catalog.py
index 4c016e34..facb4552 100644
--- a/atr/shared/catalog.py
+++ b/atr/shared/catalog.py
@@ -75,20 +75,28 @@ def _artifact(row: sql.Artifact, downloadable: bool, archived: bool) -> models.a
         # (graduated from an umbrella, or shifted to the Attic) resolve where they actually live. The
         # signature, checksum and SBOM share the directory
         directory = safe.RelPath(row.download_path_suffix)
-        artifact_url = util.download_url_for_path(
-            directory.append(row.artifact_path), util.DownloadFile.ARTIFACT, archived=archived
+        artifact_url = util.released_dist_url(
+            util.download_url_for_path(
+                directory.append(row.artifact_path), util.DownloadFile.ARTIFACT, archived=archived
+            )
         )
         if row.signature_path:
-            signature_url = util.download_url_for_path(
-                directory.append(row.signature_path), util.DownloadFile.METADATA, archived=archived
+            signature_url = util.released_dist_url(
+                util.download_url_for_path(
+                    directory.append(row.signature_path), util.DownloadFile.METADATA, archived=archived
+                )
             )
         if row.checksum_path:
-            checksum_url = util.download_url_for_path(
-                directory.append(row.checksum_path), util.DownloadFile.METADATA, archived=archived
+            checksum_url = util.released_dist_url(
+                util.download_url_for_path(
+                    directory.append(row.checksum_path), util.DownloadFile.METADATA, archived=archived
+                )
             )
         if row.sbom_path:
-            sbom_url = util.download_url_for_path(
-                directory.append(row.sbom_path), util.DownloadFile.METADATA, archived=archived
+            sbom_url = util.released_dist_url(
+                util.download_url_for_path(
+                    directory.append(row.sbom_path), util.DownloadFile.METADATA, archived=archived
+                )
             )
     return models.api.CatalogArtifact(
         artifact_path=row.artifact_path,
diff --git a/atr/util.py b/atr/util.py
index 8bb24200..97abc568 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -1280,6 +1280,15 @@ async def read_file_for_viewer(full_path: safe.StatePath, max_size: int) -> tupl
     return content, is_text, is_truncated, error_message
 
 
+def released_dist_url(url: str) -> str:
+    # Temporary fix for alpha: a released artifact's files are assumed to have been moved out of
+    # ATR's beta dist area into the release area, so point downloads there rather than at /dist/atr
+    # TODO: Remove this once ATR performs the SVN move to the release area itself
+    if "dist/atr" in url:
+        return url.replace("dist/atr", "dist/release")
+    return url
+
+
 async def session_cache_read() -> dict[str, dict]:
     cache_path = pathlib.Path(config.get().STATE_DIR) / "cache" / "user_session_cache.json"
     try:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org