[llvm] [Github] Add PR author name to subscription email (PR #68440)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 8 19:35:55 PDT 2023


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/68440

>From 887903650707561b1701f60b588e0db7e7aa8550 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Fri, 6 Oct 2023 12:19:56 -0700
Subject: [PATCH 1/2] [Github] Add PR author name to subscription email

Currently the email that gets sent out to people subscribing to a label
that the bot tags on the PR doesn't include any authorship information
which some people are interested in having. This patch adds an author
field to the message with the relevant information.
---
 llvm/utils/git/github-automation.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index b90c68a3618b9d7..cd549e75bf7d6cd 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -165,6 +165,8 @@ def run(self) -> bool:
 {self.COMMENT_TAG}
 {team_mention}
 
+Author: {self.pr._user.name} ({self.pr._user.login})
+
 <details>
 <summary>Changes</summary>
 

>From f89660c49e7b7f956cedd1a530623c68faa2bc50 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Mon, 9 Oct 2023 02:35:32 +0000
Subject: [PATCH 2/2] Fix issue with PRs, add support for tagging issues with
 the author

---
 llvm/utils/git/github-automation.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index cd549e75bf7d6cd..52523704fe82dc8 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -82,6 +82,8 @@ def run(self) -> bool:
         comment = f"""
 @llvm/{team.slug}
 
+Author: {self.issue.user.name} ({self.issue.user.login})
+
 <details>
 {body}
 </details>
@@ -165,7 +167,7 @@ def run(self) -> bool:
 {self.COMMENT_TAG}
 {team_mention}
 
-Author: {self.pr._user.name} ({self.pr._user.login})
+Author: {self.pr.user.name} ({self.pr.user.login})
 
 <details>
 <summary>Changes</summary>



More information about the llvm-commits mailing list