This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new 557a9c5  Add a preview of the download path to the release 
announcement form
557a9c5 is described below

commit 557a9c5361c7f5c55fbe2c01d90d438e36b8601a
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jun 10 17:23:40 2025 +0100

    Add a preview of the download path to the release announcement form
---
 atr/routes/announce.py               | 8 +++++++-
 atr/templates/announce-selected.html | 9 +++++++++
 atr/util.py                          | 7 +++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/atr/routes/announce.py b/atr/routes/announce.py
index 2f9fef5..3a41b61 100644
--- a/atr/routes/announce.py
+++ b/atr/routes/announce.py
@@ -96,7 +96,13 @@ async def selected(session: routes.CommitterSession, 
project_name: str, version_
     announce_form.subject.data = f"[ANNOUNCE] {project_display_name} 
{version_name} released"
     # The body can be changed, either from VoteTemplate or from the form
     announce_form.body.data = await 
construct.announce_release_default(project_name)
-    return await template.render("announce-selected.html", release=release, 
announce_form=announce_form)
+
+    eventual_path = util.release_directory_eventual(release)
+    finished_path = util.get_finished_dir()
+    url_path = f"/downloads/{eventual_path.relative_to(finished_path)}/"
+    return await template.render(
+        "announce-selected.html", release=release, 
announce_form=announce_form, url_path=url_path
+    )
 
 
 @routes.committer("/announce/<project_name>/<version_name>", methods=["POST"])
diff --git a/atr/templates/announce-selected.html 
b/atr/templates/announce-selected.html
index e05c014..871a25b 100644
--- a/atr/templates/announce-selected.html
+++ b/atr/templates/announce-selected.html
@@ -143,6 +143,15 @@
         </div>
       </div>
     </div>
+    <div class="row mb-3 pb-3 border-bottom">
+      <label class="col-sm-3 col-form-label text-sm-end">Download path</label>
+      <div class="col-md-9 mb-3">
+        <pre class="p-2 px-3 bg-light border rounded font-monospace 
overflow-auto">{{ url_path }}</pre>
+      </div>
+      <div class="col-md-9 offset-md-3">
+        <p>This value is read-only.</p>
+      </div>
+    </div>
     <div class="row mb-3">
       <div class="col-md-9 offset-md-3">
         <div class="form-check">
diff --git a/atr/util.py b/atr/util.py
index c26e22b..4b23687 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -532,6 +532,13 @@ def release_directory_base(release: models.Release) -> 
pathlib.Path:
     return base_dir / project_name / version_name
 
 
+def release_directory_eventual(release: models.Release) -> pathlib.Path:
+    """Return the path to the eventual destination of the release files."""
+    path_project = release.project.name
+    path_version = release.version
+    return get_finished_dir() / path_project / path_version
+
+
 def release_directory_revision(release: models.Release) -> pathlib.Path | None:
     """Return the path to the directory containing the active files for a 
given release phase."""
     path_project = release.project.name


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to