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-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 7882715  Allow getting an archived message from any public ASF mailing 
list
7882715 is described below

commit 7882715d655d5dafaf66a352aad01a2986d5c25d
Author: Sean B. Palmer <[email protected]>
AuthorDate: Sun Nov 16 19:06:05 2025 +0000

    Allow getting an archived message from any public ASF mailing list
---
 atr/api/__init__.py          | 3 ++-
 atr/db/interaction.py        | 7 +++++++
 atr/get/vote.py              | 3 ++-
 atr/post/resolve.py          | 3 ++-
 atr/storage/writers/cache.py | 4 ++--
 atr/storage/writers/vote.py  | 3 ++-
 atr/util.py                  | 7 +++----
 7 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/atr/api/__init__.py b/atr/api/__init__.py
index bcbb087..ba2b740 100644
--- a/atr/api/__init__.py
+++ b/atr/api/__init__.py
@@ -1252,10 +1252,11 @@ async def vote_tabulate(data: 
models.api.VoteTabulateArgs) -> DictResponse:
     if latest_vote_task is None:
         raise exceptions.NotFound("No vote task found")
     task_mid = interaction.task_mid_get(latest_vote_task)
+    task_recipient = interaction.task_recipient_get(latest_vote_task)
 
     async with storage.write() as write:
         wagp = write.as_general_public()
-        archive_url = await wagp.cache.get_message_archive_url(task_mid)
+        archive_url = await wagp.cache.get_message_archive_url(task_mid, 
task_recipient)
     if archive_url is None:
         raise exceptions.NotFound("No archive URL found")
 
diff --git a/atr/db/interaction.py b/atr/db/interaction.py
index 7a2060e..ecf1761 100644
--- a/atr/db/interaction.py
+++ b/atr/db/interaction.py
@@ -350,6 +350,13 @@ def task_mid_get(latest_vote_task: sql.Task) -> str | None:
     return result.mid
 
 
+def task_recipient_get(latest_vote_task: sql.Task) -> str | None:
+    result = latest_vote_task.result
+    if not isinstance(result, results.VoteInitiate):
+        return None
+    return result.email_to
+
+
 async def tasks_ongoing(project_name: str, version_name: str, revision_number: 
str | None = None) -> int:
     tasks = sqlmodel.select(sqlalchemy.func.count()).select_from(sql.Task)
     async with db.session() as data:
diff --git a/atr/get/vote.py b/atr/get/vote.py
index 87bdb32..98eb936 100644
--- a/atr/get/vote.py
+++ b/atr/get/vote.py
@@ -80,9 +80,10 @@ async def selected(session: web.Committer | None, 
project_name: str, version_nam
 
         # Move task_mid_get here?
         task_mid = interaction.task_mid_get(latest_vote_task)
+        task_recipient = interaction.task_recipient_get(latest_vote_task)
         async with storage.write(session) as write:
             wagp = write.as_general_public()
-            archive_url = await wagp.cache.get_message_archive_url(task_mid)
+            archive_url = await wagp.cache.get_message_archive_url(task_mid, 
task_recipient)
 
     resolve_form = None
     if can_resolve:
diff --git a/atr/post/resolve.py b/atr/post/resolve.py
index 5d8a376..609f537 100644
--- a/atr/post/resolve.py
+++ b/atr/post/resolve.py
@@ -98,10 +98,11 @@ async def _tabulate(session: web.Committer, project_name: 
str, version_name: str
     latest_vote_task = await interaction.release_latest_vote_task(release)
     if latest_vote_task is not None:
         task_mid = interaction.task_mid_get(latest_vote_task)
+        task_recipient = interaction.task_recipient_get(latest_vote_task)
         if task_mid:
             async with storage.write(session) as write:
                 wagp = write.as_general_public()
-                archive_url = await 
wagp.cache.get_message_archive_url(task_mid)
+                archive_url = await 
wagp.cache.get_message_archive_url(task_mid, task_recipient)
 
     if archive_url:
         thread_id = archive_url.split("/")[-1]
diff --git a/atr/storage/writers/cache.py b/atr/storage/writers/cache.py
index d77811c..6cccb8c 100644
--- a/atr/storage/writers/cache.py
+++ b/atr/storage/writers/cache.py
@@ -39,7 +39,7 @@ class GeneralPublic:
         self.__data = data
         self.__asf_uid = write.authorisation.asf_uid
 
-    async def get_message_archive_url(self, task_mid: str | None) -> str | 
None:
+    async def get_message_archive_url(self, task_mid: str | None, recipient: 
str | None = None) -> str | None:
         if task_mid is None:
             return None
         if "@" not in task_mid:
@@ -52,7 +52,7 @@ class GeneralPublic:
         if url is not None:
             return url
 
-        url = await util.task_archive_url(task_mid)
+        url = await util.task_archive_url(task_mid, recipient)
         if url is not None:
             await self.__data.ns_text_set(
                 "mid-url-cache",
diff --git a/atr/storage/writers/vote.py b/atr/storage/writers/vote.py
index 51f642d..5f2650c 100644
--- a/atr/storage/writers/vote.py
+++ b/atr/storage/writers/vote.py
@@ -301,7 +301,8 @@ class CommitteeMember(CommitteeParticipant):
             # Then we automatically start the Incubator PMC vote
             # TODO: Note on the resolve vote page that resolving the Project 
PPMC vote starts the Incubator PMC vote
             task_mid = interaction.task_mid_get(latest_vote_task)
-            archive_url = await 
self.__write_as.cache.get_message_archive_url(task_mid)
+            task_recipient = interaction.task_recipient_get(latest_vote_task)
+            archive_url = await 
self.__write_as.cache.get_message_archive_url(task_mid, task_recipient)
             if archive_url is None:
                 raise ValueError("No archive URL found for podling vote")
             thread_id = archive_url.split("/")[-1]
diff --git a/atr/util.py b/atr/util.py
index 4c2fb13..32c1d4f 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -830,13 +830,12 @@ def static_url(filename: str) -> str:
     return quart.url_for("static", filename=filename)
 
 
-async def task_archive_url(task_mid: str) -> str | None:
+async def task_archive_url(task_mid: str, recipient: str | None = None) -> str 
| None:
     if "@" not in task_mid:
         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_ADDRESS.replace("@", ".")
+    recipient_address = recipient or USER_TESTS_ADDRESS
+    lid = recipient_address.replace("@", ".")
     url = 
f"https://lists.apache.org/api/email.json?id=%3C{task_mid}%3E&listid=%3C{lid}%3E";
     try:
         async with aiohttp.ClientSession() as session:


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

Reply via email to