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 dec2be6  Indicate the voting round and redirect appropriately
dec2be6 is described below

commit dec2be66e8291c124cca3258513fba419306643c
Author: Sean B. Palmer <[email protected]>
AuthorDate: Mon Jun 30 19:20:00 2025 +0100

    Indicate the voting round and redirect appropriately
---
 atr/routes/resolve.py                          | 52 ++++++++++++++++----------
 atr/routes/vote.py                             |  2 +-
 atr/templates/check-selected-release-info.html | 12 ++++++
 atr/templates/check-selected-vote-email.html   |  2 +-
 atr/templates/check-selected.html              |  8 +++-
 5 files changed, 54 insertions(+), 22 deletions(-)

diff --git a/atr/routes/resolve.py b/atr/routes/resolve.py
index 8ada8b7..16ae8fa 100644
--- a/atr/routes/resolve.py
+++ b/atr/routes/resolve.py
@@ -58,7 +58,20 @@ async def selected_post(
 ) -> response.Response | str:
     """Resolve a vote."""
     await session.check_access(project_name)
-    release = await session.release(project_name, version_name, 
phase=models.ReleasePhase.RELEASE_CANDIDATE)
+
+    release = await session.release(
+        project_name,
+        version_name,
+        with_project=True,
+        with_committee=True,
+        phase=models.ReleasePhase.RELEASE_CANDIDATE,
+    )
+
+    is_podling = False
+    if release.project.committee is not None:
+        is_podling = release.project.committee.is_podling
+    podling_thread_id = release.podling_thread_id
+
     latest_vote_task = await release_latest_vote_task(release)
     if latest_vote_task is None:
         return "No vote task found, unable to send resolution message."
@@ -70,10 +83,22 @@ async def selected_post(
         )
     email_body = util.unwrap(resolve_form.email_body.data)
     vote_result = util.unwrap(resolve_form.vote_result.data)
+    first_podling_round_passed = is_podling and (podling_thread_id is not 
None) and (vote_result == "passed")
     release, success_message = await _resolve_vote(
-        session, project_name, version_name, vote_result, email_body, 
latest_vote_task
+        session,
+        project_name,
+        vote_result,
+        email_body,
+        latest_vote_task,
+        release,
+        first_podling_round_passed,
     )
-    destination = finish.selected if (vote_result == "passed") else 
compose.selected
+    if first_podling_round_passed:
+        destination = vote.selected
+    elif vote_result == "passed":
+        destination = finish.selected
+    else:
+        destination = compose.selected
     return await session.redirect(
         destination, project_name=project_name, version_name=version_name, 
success=success_message
     )
@@ -107,10 +132,11 @@ def task_mid_get(latest_vote_task: models.Task) -> str | 
None:
 async def _resolve_vote(
     session: routes.CommitterSession,
     project_name: str,
-    version_name: str,
     vote_result: str,
     resolution_body: str,
     latest_vote_task: models.Task,
+    release: models.Release,
+    first_podling_round_passed: bool,
 ) -> tuple[models.Release, str]:
     # Check that the user has access to the project
     await session.check_access(project_name)
@@ -118,22 +144,10 @@ async def _resolve_vote(
     # Update release status in the database
     async with db.session() as data:
         async with data.begin():
-            release = await session.release(
-                project_name,
-                version_name,
-                with_project=True,
-                with_committee=True,
-                phase=models.ReleasePhase.RELEASE_CANDIDATE,
-                data=data,
-            )
-
-            is_podling = False
-            if release.project.committee is not None:
-                is_podling = release.project.committee.is_podling
-            podling_thread_id = release.podling_thread_id
-
+            # Attach the existing release to the session
+            release = await data.merge(release)
             # Update the release phase based on vote result
-            if is_podling and (podling_thread_id is None) and (vote_result == 
"passed"):
+            if first_podling_round_passed:
                 # This is the first podling vote, by the PPMC and not the 
Incubator PMC
                 # In this branch, we do not move to RELEASE_PREVIEW but keep 
everything the same
                 # We only set the podling_thread_id to the thread_id of the 
vote thread
diff --git a/atr/routes/vote.py b/atr/routes/vote.py
index b2f8649..5d452da 100644
--- a/atr/routes/vote.py
+++ b/atr/routes/vote.py
@@ -38,7 +38,7 @@ import atr.template as template
 import atr.util as util
 
 # "CAH5JyZo8QnWmg9CwRSwWY=givhxw4nilyenjo71fkdk81j5...@mail.gmail.com"
-TEST_MID: Final[str | None] = 
"CAH5JyZo8QnWmg9CwRSwWY=givhxw4nilyenjo71fkdk81j5...@mail.gmail.com"
+TEST_MID: Final[str | None] = None
 _THREAD_URLS_FOR_DEVELOPMENT: Final[dict[str, str]] = {
     "CAH5JyZo8QnWmg9CwRSwWY=givhxw4nilyenjo71fkdk81j5...@mail.gmail.com": 
"https://lists.apache.org/thread/z0o7xnjnyw2o886rxvvq2ql4rdfn754w";,
     "[email protected]": 
"https://lists.apache.org/thread/619hn4x796mh3hkk3kxg1xnl48dy2s64";,
diff --git a/atr/templates/check-selected-release-info.html 
b/atr/templates/check-selected-release-info.html
index 2b04290..0a2a884 100644
--- a/atr/templates/check-selected-release-info.html
+++ b/atr/templates/check-selected-release-info.html
@@ -25,6 +25,18 @@
             </a>
             {% if revision_editor %}by {{ revision_editor }}{% endif %}
           </p>
+        {% elif release.project.committee.is_podling %}
+          {% if release.podling_thread_id %}
+            <p>
+              <strong>Voting round:</strong> 2
+              (<a href="https://lists.apache.org/thread/{{ 
release.podling_thread_id }}"
+   target="_blank">round 1 results</a>)
+            </p>
+          {% else %}
+            <p>
+              <strong>Voting round:</strong> 1
+            </p>
+          {% endif %}
         {% endif %}
       </div>
     </div>
diff --git a/atr/templates/check-selected-vote-email.html 
b/atr/templates/check-selected-vote-email.html
index 71543b1..57c6c86 100644
--- a/atr/templates/check-selected-vote-email.html
+++ b/atr/templates/check-selected-vote-email.html
@@ -52,7 +52,7 @@
     {% endif %}
   {% else %}
     <p class="mb-0 text-muted">
-      <i class="bi bi-question-circle me-1"></i> Vote email: No vote 
initiation task found for this release.
+      <i class="bi bi-question-circle me-1"></i> The task to send the email to 
start the vote is not yet complete.
     </p>
   {% endif %}
 </div>
diff --git a/atr/templates/check-selected.html 
b/atr/templates/check-selected.html
index 0ed4fe9..a21f737 100644
--- a/atr/templates/check-selected.html
+++ b/atr/templates/check-selected.html
@@ -61,7 +61,13 @@
       Vote on <strong>{{ release.project.short_display_name }}</strong> <em>{{ 
release.version }}</em>
     </h1>
     <p>
-      The {{ release.committee.display_name }} committee is currently voting 
on the <strong>release candidate</strong> for {{ release.project.display_name 
}} {{ version_name }}. This page allows you to review the automated checks run 
on the files in the release.
+      The
+      {% if release.podling_thread_id %}
+        Incubator
+      {% else %}
+        {{ release.committee.display_name }}
+      {% endif %}
+      committee is currently voting on the <strong>release candidate</strong> 
for {{ release.project.display_name }} {{ version_name }}. This page allows you 
to review the automated checks run on the files in the release.
     </p>
   {% endif %}
 


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

Reply via email to