This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/sbp by this push:
     new 2e60deba Extract names when tabulating votes
2e60deba is described below

commit 2e60debaa423e63c325c666eea7c80e54aa4cb40
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Mar 25 17:18:34 2026 +0000

    Extract names when tabulating votes
---
 atr/post/user.py |  2 ++
 atr/tabulate.py  | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/atr/post/user.py b/atr/post/user.py
index ffc93747..b4d5c7ad 100644
--- a/atr/post/user.py
+++ b/atr/post/user.py
@@ -157,6 +157,7 @@ def _render_summary_table(block: htm.Block, summary: 
dict[str, int]) -> None:
 def _render_votes_table(block: htm.Block, tabulated_votes: dict[str, 
models.tabulate.VoteEmail]) -> None:
     thead = htm.thead[
         htm.tr[
+            htm.th["Name"],
             htm.th["UID or email"],
             htm.th(".text-center")["Vote"],
             htm.th(".text-center")["Status"],
@@ -172,6 +173,7 @@ def _render_votes_table(block: htm.Block, tabulated_votes: 
dict[str, models.tabu
             vote_class = ".atr-red"
         tbody.append(
             htm.tr[
+                htm.td(".atr-nowrap")[vote_email.name],
                 htm.td(".atr-nowrap")[vote_email.asf_uid_or_email],
                 
htm.td(f".atr-nowrap.text-center{vote_class}")[vote_email.vote.value],
                 htm.td(".atr-nowrap.text-center")[vote_email.status.value],
diff --git a/atr/tabulate.py b/atr/tabulate.py
index b21b07f0..e1b7e2fd 100644
--- a/atr/tabulate.py
+++ b/atr/tabulate.py
@@ -234,6 +234,17 @@ def _format_duration(duration_hours: float | int) -> str:
     return " and ".join(parts)
 
 
+def _name_from_raw(from_raw: str) -> str:
+    angle = from_raw.find("<")
+    if angle <= 0:
+        return ""
+    name = from_raw[:angle].strip().strip('"')
+    via_index = name.find(" via ")
+    if via_index >= 0:
+        name = name[:via_index]
+    return name.strip()
+
+
 def _vote_break(line: str) -> bool:
     if line == "-- ":
         # Start of a signature
@@ -297,16 +308,14 @@ def _vote_identity(
     from_email_lower = util.email_from_uid(from_raw)
     if not from_email_lower:
         return False, "", "", None
-    name = ""
+    name = _name_from_raw(from_raw)
     from_email_lower = from_email_lower.removesuffix(".invalid")
     asf_uid = None
     if from_email_lower.endswith("@apache.org"):
-        name = "-"
         asf_uid = from_email_lower.split("@")[0]
     else:
         if ("via" in from_raw) and (from_email_lower.replace("@", ".") in 
list_email):
             # Take the last CC, appended by ezmlm, and use that as the email. 
Otherwise, use their name
-            name = from_raw[: from_raw.index("via") - 1]
             if cc:
                 from_email_lower = util.email_from_uid(cc[-1]) or 
from_email_lower
         if from_email_lower in email_to_uid:


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

Reply via email to