You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2025/08/01 13:33:42 UTC

(tooling-trusted-release) branch main updated: Convert all instances of the user tests address to a constant

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 c278206  Convert all instances of the user tests address to a constant
c278206 is described below

commit c27820681313dfce75ab4193726477d12a1122d0
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Fri Aug 1 14:32:45 2025 +0100

    Convert all instances of the user tests address to a constant
---
 atr/routes/announce.py                      | 3 ++-
 atr/routes/projects.py                      | 2 +-
 atr/routes/resolve.py                       | 2 +-
 atr/routes/vote.py                          | 3 ++-
 atr/routes/voting.py                        | 3 ++-
 atr/templates/announce-selected.html        | 2 +-
 atr/templates/voting-selected-revision.html | 2 +-
 atr/util.py                                 | 2 ++
 8 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/atr/routes/announce.py b/atr/routes/announce.py
index 8b97ffe..aed7f7f 100644
--- a/atr/routes/announce.py
+++ b/atr/routes/announce.py
@@ -109,6 +109,7 @@ async def selected(session: routes.CommitterSession, project_name: str, version_
         "announce-selected.html",
         release=release,
         announce_form=announce_form,
+        user_tests_address=util.USER_TESTS_ADDRESS,
     )
 
 
@@ -265,7 +266,7 @@ async def _create_announce_form_instance(
     """Create and return an instance of the AnnounceForm."""
 
     mailing_list_choices: forms.Choices = sorted([(recipient, recipient) for recipient in permitted_recipients])
-    mailing_list_default = "user-tests@tooling.apache.org"
+    mailing_list_default = util.USER_TESTS_ADDRESS
 
     form_instance = await AnnounceForm.create_form(data=data)
     forms.choices(
diff --git a/atr/routes/projects.py b/atr/routes/projects.py
index 3ede1a5..c3255ab 100644
--- a/atr/routes/projects.py
+++ b/atr/routes/projects.py
@@ -87,7 +87,7 @@ class ReleasePolicyForm(forms.Typed):
         placeholder="E.g. dev@project.apache.org",
         description="Note: This field determines where vote and finished release announcement"
         "emails are sent. You can set this value to your own mailing list, but ATR will "
-        "currently only let you send to user-tests@tooling.apache.org.",
+        f"currently only let you send to {util.USER_TESTS_ADDRESS}.",
     )
     default_min_hours_value_at_render = forms.hidden()
     min_hours = forms.integer(
diff --git a/atr/routes/resolve.py b/atr/routes/resolve.py
index 464e86f..1d0acf2 100644
--- a/atr/routes/resolve.py
+++ b/atr/routes/resolve.py
@@ -365,7 +365,7 @@ async def _resolve_vote(
                 thread_id = archive_url.split("/")[-1]
                 release.podling_thread_id = thread_id
                 # incubator_vote_address = "general@incubator.apache.org"
-                incubator_vote_address = "user-test@tooling.apache.org"
+                incubator_vote_address = util.USER_TESTS_ADDRESS
                 if not release.project.committee:
                     raise ValueError("Project has no committee")
                 revision_number = release.latest_revision_number
diff --git a/atr/routes/vote.py b/atr/routes/vote.py
index 470dba0..1b2f38b 100644
--- a/atr/routes/vote.py
+++ b/atr/routes/vote.py
@@ -247,7 +247,8 @@ async def _task_archive_url(task_mid: str) -> str | None:
         return None
 
     # TODO: This List ID will be dynamic when we allow posting to arbitrary lists
-    lid = "user-tests.tooling.apache.org"
+    # lid = "user-tests.tooling.apache.org"
+    lid = util.USER_TESTS_ADDRESS.replace("@", ".")
     url = f"https://lists.apache.org/api/email.lua?id=%3C{task_mid}%3E&listid=%3C{lid}%3E"
     try:
         async with aiohttp.ClientSession() as session:
diff --git a/atr/routes/voting.py b/atr/routes/voting.py
index 1716407..0222ed9 100644
--- a/atr/routes/voting.py
+++ b/atr/routes/voting.py
@@ -172,6 +172,7 @@ async def selected_revision(
         revision=revision,
         keys_warning=keys_warning,
         manual_vote_process_form=manual_vote_process_form,
+        user_tests_address=util.USER_TESTS_ADDRESS,
     )
 
 
@@ -347,7 +348,7 @@ async def _form(
     form.release_name.data = release.name
     # Choices and defaults for mailing list
     choices: forms.Choices = sorted([(recipient, recipient) for recipient in permitted_recipients])
-    forms.choices(form.mailing_list, choices, default="user-tests@tooling.apache.org")
+    forms.choices(form.mailing_list, choices, default=util.USER_TESTS_ADDRESS)
     # Description
     form.mailing_list.description = f"""\
 NOTE: The limited options above are provided for testing purposes.
diff --git a/atr/templates/announce-selected.html b/atr/templates/announce-selected.html
index ce7bb42..1c1e451 100644
--- a/atr/templates/announce-selected.html
+++ b/atr/templates/announce-selected.html
@@ -63,7 +63,7 @@
 
   <h2>Announce this release</h2>
 
-  <p>This form will send an announcement to the ASF user-tests@tooling.apache.org mailing list.</p>
+  <p>This form will send an announcement to the ASF {{ user_tests_address }} mailing list.</p>
 
   <form method="post"
         id="announce-release-form"
diff --git a/atr/templates/voting-selected-revision.html b/atr/templates/voting-selected-revision.html
index 6c3490e..84a9f86 100644
--- a/atr/templates/voting-selected-revision.html
+++ b/atr/templates/voting-selected-revision.html
@@ -47,7 +47,7 @@
     {{ forms.errors_summary(form) }}
 
     <div class="p-3 mb-4 bg-warning-subtle border border-warning rounded">
-      <strong>Note:</strong> This feature is currently in development. The form below only sends email to <a href="https://lists.apache.org/list.html?user-tests@tooling.apache.org">a test mailing list</a> or yourself.
+      <strong>Note:</strong> This feature is currently in development. The form below only sends email to <a href="https://lists.apache.org/list.html?{{ user_tests_address }}">a test mailing list</a> or yourself.
     </div>
 
     <form method="post"
diff --git a/atr/util.py b/atr/util.py
index 761cc4f..9949548 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -54,6 +54,8 @@ import atr.user as user
 
 T = TypeVar("T")
 
+USER_TESTS_ADDRESS: Final[str] = "user-tests@tooling.apache.org"
+
 # TODO: Move to committee data
 # Standing committees are those which cannot make releases, by policy
 _STANDING_COMMITTEES: Final[set[str]] = {


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