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 5d69369  Add an example thread to use for testing votes
5d69369 is described below

commit 5d69369b0e941437a891a81170b0879f73510995
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Jun 27 14:51:34 2025 +0100

    Add an example thread to use for testing votes
---
 atr/routes/resolve.py            |  2 +-
 atr/routes/vote.py               | 21 ++++++++++++++-------
 atr/templates/vote-tabulate.html |  4 ++--
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/atr/routes/resolve.py b/atr/routes/resolve.py
index 617d73e..b862583 100644
--- a/atr/routes/resolve.py
+++ b/atr/routes/resolve.py
@@ -138,7 +138,7 @@ async def selected_post(
 
 def task_mid_get(latest_vote_task: models.Task) -> str | None:
     if util.is_dev_environment():
-        return "[email protected]"
+        return vote.TEST_MID
     # TODO: Improve this
     task_mid = None
 
diff --git a/atr/routes/vote.py b/atr/routes/vote.py
index b2bb95e..765eadf 100644
--- a/atr/routes/vote.py
+++ b/atr/routes/vote.py
@@ -32,6 +32,8 @@ import atr.tasks.message as message
 import atr.template as template
 import atr.util as util
 
+TEST_MID = "CAH5JyZo8QnWmg9CwRSwWY=givhxw4nilyenjo71fkdk81j5...@mail.gmail.com"
+
 
 class CastVoteForm(util.QuartFormTyped):
     """Form for casting a vote."""
@@ -57,12 +59,12 @@ async def selected(session: routes.CommitterSession, 
project_name: str, version_
     archive_url = None
     task_mid = None
 
-    if util.is_dev_environment() and (latest_vote_task is not None):
-        logging.warning("LOCAL_DEBUG: Setting vote task to completed")
-        latest_vote_task.status = models.TaskStatus.COMPLETED
-        latest_vote_task.result = [json.dumps({"mid": 
"[email protected]"})]
-
     if latest_vote_task is not None:
+        if util.is_dev_environment():
+            logging.warning("Setting vote task to completed in dev 
environment")
+            latest_vote_task.status = models.TaskStatus.COMPLETED
+            latest_vote_task.result = [json.dumps({"mid": TEST_MID})]
+
         # Move task_mid_get here?
         task_mid = resolve.task_mid_get(latest_vote_task)
         archive_url = await _task_archive_url_cached(task_mid)
@@ -202,8 +204,13 @@ async def _task_archive_url(task_mid: str) -> str | None:
 
 
 async def _task_archive_url_cached(task_mid: str | None) -> str | None:
-    if util.is_dev_environment():
-        return 
"https://lists.apache.org/thread/619hn4x796mh3hkk3kxg1xnl48dy2s64";
+    dev_urls = {
+        "CAH5JyZo8QnWmg9CwRSwWY=givhxw4nilyenjo71fkdk81j5...@mail.gmail.com": 
"https://lists.apache.org/thread/z0o7xnjnyw2o886rxvvq2ql4rdfn754w";,
+        "[email protected]": 
"https://lists.apache.org/thread/619hn4x796mh3hkk3kxg1xnl48dy2s64";,
+    }
+    if task_mid in dev_urls:
+        return dev_urls[task_mid]
+
     if task_mid is None:
         return None
     if "@" not in task_mid:
diff --git a/atr/templates/vote-tabulate.html b/atr/templates/vote-tabulate.html
index d8a6f3f..30a5a28 100644
--- a/atr/templates/vote-tabulate.html
+++ b/atr/templates/vote-tabulate.html
@@ -10,8 +10,8 @@
 
 {% block content %}
   <p>
-    <a href="{{ as_url(routes.release.view, project_name=release.project.name, 
version_name=release.version) }}"
-       class="atr-back-link">← Back to release</a>
+    <a href="{{ as_url(routes.vote.selected, 
project_name=release.project.name, version_name=release.version) }}"
+       class="atr-back-link">← Back to vote</a>
   </p>
 
   <h1>Tabulated votes</h1>


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

Reply via email to