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/04/30 17:57:18 UTC

(tooling-trusted-release) branch main updated: Fix some problems with sending vote emails

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 b58d163  Fix some problems with sending vote emails
b58d163 is described below

commit b58d1638977e59eb82e2cd567d8c4186661e146d
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed Apr 30 18:57:01 2025 +0100

    Fix some problems with sending vote emails
---
 atr/construct.py     | 10 +++++++---
 atr/routes/voting.py | 21 +++------------------
 2 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/atr/construct.py b/atr/construct.py
index 9dc2eb4..1fa0e10 100644
--- a/atr/construct.py
+++ b/atr/construct.py
@@ -108,9 +108,13 @@ async def start_vote_body(body: str, options: StartVoteOptions) -> str:
     async with db.session() as data:
         user_key = await data.public_signing_key(apache_uid=options.asfuid).get()
         user_key_fingerprint = user_key.fingerprint if user_key else "0000000000000000000000000000000000000000"
-        release = await data.release(name=options.project_name, version=options.version_name).demand(
-            RuntimeError(f"Release {options.project_name} {options.version_name} not found")
-        )
+        # Do not limit by phase, as it may be at RELEASE_CANDIDATE here if called by the task
+        release = await data.release(
+            project_name=options.project_name,
+            version=options.version_name,
+            _project=True,
+            _committee=True,
+        ).demand(RuntimeError(f"Release {options.project_name} {options.version_name} not found"))
 
     try:
         host = quart.request.host
diff --git a/atr/routes/voting.py b/atr/routes/voting.py
index 3393fdb..832a91f 100644
--- a/atr/routes/voting.py
+++ b/atr/routes/voting.py
@@ -26,8 +26,8 @@ import atr.db as db
 import atr.db.models as models
 import atr.routes as routes
 import atr.routes.compose as compose
-import atr.routes.resolve as resolve
 import atr.routes.root as root
+import atr.routes.vote as vote
 import atr.tasks.vote as tasks_vote
 import atr.user as user
 import atr.util as util
@@ -54,8 +54,6 @@ async def selected_revision(
                 compose.selected, error="You must be on the PMC of this project to start a vote"
             )
         committee = util.unwrap(release.committee)
-
-        sender = f"{session.uid}@apache.org"
         permitted_recipients = util.permitted_recipients(session.uid)
 
         if release.vote_policy:
@@ -152,24 +150,11 @@ async def selected_revision(
             await data.flush()
             await data.commit()
 
-            # NOTE: During debugging, this email is actually sent elsewhere
-            # TODO: We should perhaps move that logic here, so that we can show the debugging address
-            # We should also log all outgoing email and the session so that users can confirm
+            # TODO: We should log all outgoing email and the session so that users can confirm
             # And can be warned if there was a failure
             # (The message should be shown on the vote resolution page)
-            # TODO: Link to the vote resolution page in the flash message
-            if email_to == sender:
-                # Test email, with no promotion
-                return await session.redirect(
-                    compose.selected,
-                    success=f"The vote announcement email will soon be sent to {email_to}. "
-                    "This is a test, and the release is not being voted on.",
-                    project_name=project_name,
-                    version_name=version,
-                )
-
             return await session.redirect(
-                resolve.selected,
+                vote.selected,
                 success=f"The vote announcement email will soon be sent to {email_to}.",
                 project_name=project_name,
                 version_name=version,


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