[llvm] Update GitHub PR Greeter (PR #194307)
Andrzej Warzyński via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 00:07:54 PDT 2026
https://github.com/banach-space updated https://github.com/llvm/llvm-project/pull/194307
>From 22c1d488599a4d401adea70ae25d765e6199b187 Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Sun, 26 Apr 2026 14:35:12 +0100
Subject: [PATCH 1/4] Update GitHub PR Greeter
Following these two discussions:
* https://discourse.llvm.org/t/rfc-mention-our-ai-policy-in-the-greeting-message-for-first-time-contributors/
* https://discourse.llvm.org/t/concerns-about-influx-of-ai-generated-bug-fixes/
Add a reference to the LLVM AI policy. In addition:
* Update the message to include links to other relevant policies as
well, since these are often shared during PR review.
* Remove the note about adding reviewers, since most projects now use
code owners and reviewers are added automatically.
* Add `Hello @{self.author} :wave:` to make the greeting more personal.
---
llvm/utils/git/github-automation.py | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index b9b5e92de3c97..8f3e47e6073a8 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -245,9 +245,10 @@ def get_user_values_str(values: list) -> str:
class PRGreeter:
COMMENT_TAG = "<!--LLVM NEW CONTRIBUTOR COMMENT-->\n"
- def __init__(self, token: str, repo: str, pr_number: int):
+ def __init__(self, token: str, repo, pr_number: int):
repo = github.Github(auth=github.Auth.Token(token)).get_repo(repo)
self.pr = repo.get_issue(pr_number).as_pull_request()
+ self.author = self.pr.user
def run(self) -> bool:
# We assume that this is only called for a PR that has just been opened
@@ -257,19 +258,18 @@ def run(self) -> bool:
comment = f"""\
{PRGreeter.COMMENT_TAG}
-Thank you for submitting a Pull Request (PR) to the LLVM Project!
+Hello @{self.author} :wave:
-This PR will be automatically labeled and the relevant teams will be notified.
+Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.
-If you wish to, you can add reviewers by using the "Reviewers" section on this page.
+* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, please add a note to the PR summary.
+* The [LLVM Code-Review Policy and Practices](https://llvm.org/docs/CodeReview.html) document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR
+* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit/PR summaries, and also includes information on obtaining commit access.
-If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using `@` followed by their GitHub username.
+If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/).
-If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.
-
-If you have further questions, they may be answered by the [LLVM GitHub User Guide](https://llvm.org/docs/GitHub.html).
-
-You can also ask questions in a comment on this PR, on the [LLVM Discord](https://discord.com/invite/xS7Z362) or on the [forums](https://discourse.llvm.org/)."""
+Thank you,
+The LLVM Community"""
self.pr.as_issue().create_comment(comment)
return True
>From c7d39e0a09482549a391aa0d1c07e88f4681a5ed Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Mon, 27 Apr 2026 18:16:04 +0100
Subject: [PATCH 2/4] Address PR comments
---
llvm/utils/git/github-automation.py | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index 8f3e47e6073a8..b19e5e80411ac 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -245,7 +245,7 @@ def get_user_values_str(values: list) -> str:
class PRGreeter:
COMMENT_TAG = "<!--LLVM NEW CONTRIBUTOR COMMENT-->\n"
- def __init__(self, token: str, repo, pr_number: int):
+ def __init__(self, token: str, repo: str, pr_number: int):
repo = github.Github(auth=github.Auth.Token(token)).get_repo(repo)
self.pr = repo.get_issue(pr_number).as_pull_request()
self.author = self.pr.user
@@ -256,20 +256,34 @@ def run(self) -> bool:
# This text is using Markdown formatting.
- comment = f"""\
+ comment_missing_email = ""
+ if self.author.email is None:
+ comment_missing_email = f"""\
+---
+
+It looks like your GitHub email is not public. Before proceeding, please update your settings so that it is public:
+* https://llvm.org/docs/DeveloperPolicy.html#email-addresses
+
+---
+"""
+
+ comment = (
+ f"""\
{PRGreeter.COMMENT_TAG}
Hello @{self.author} :wave:
Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.
-* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, please add a note to the PR summary.
+* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, please add a note to the PR description.
* The [LLVM Code-Review Policy and Practices](https://llvm.org/docs/CodeReview.html) document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR
-* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit/PR summaries, and also includes information on obtaining commit access.
-
-If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/).
+* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit summaries, and also includes notes on our CI system.
+If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/)."""
+ + comment_missing_email
+ + f"""\
Thank you,
The LLVM Community"""
+ )
self.pr.as_issue().create_comment(comment)
return True
>From 09dc23868491b7af08e881e8f51d86f015c82bdd Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Tue, 28 Apr 2026 10:26:26 +0100
Subject: [PATCH 3/4] Revert the logic with self.author.email
---
llvm/utils/git/github-automation.py | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index b19e5e80411ac..be09705960eeb 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -256,19 +256,7 @@ def run(self) -> bool:
# This text is using Markdown formatting.
- comment_missing_email = ""
- if self.author.email is None:
- comment_missing_email = f"""\
----
-
-It looks like your GitHub email is not public. Before proceeding, please update your settings so that it is public:
-* https://llvm.org/docs/DeveloperPolicy.html#email-addresses
-
----
-"""
-
- comment = (
- f"""\
+ comment = f"""\
{PRGreeter.COMMENT_TAG}
Hello @{self.author} :wave:
@@ -276,14 +264,12 @@ def run(self) -> bool:
* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, please add a note to the PR description.
* The [LLVM Code-Review Policy and Practices](https://llvm.org/docs/CodeReview.html) document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR
-* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit summaries, and also includes notes on our CI system.
+* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit summaries, your GitHub settings (see e.g. [Email Addresses](https://llvm.org/docs/DeveloperPolicy.html#email-addresses)) and also includes notes on our CI system.
+
+If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/).
-If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/)."""
- + comment_missing_email
- + f"""\
Thank you,
The LLVM Community"""
- )
self.pr.as_issue().create_comment(comment)
return True
>From 3a8daae383f4e6773b695a741459b37590562f9d Mon Sep 17 00:00:00 2001
From: Andrzej Warzynski <andrzej.warzynski at arm.com>
Date: Wed, 29 Apr 2026 08:07:40 +0100
Subject: [PATCH 4/4] Address comments from Victor
---
llvm/utils/git/github-automation.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index be09705960eeb..b22b2bdaa12de 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -262,8 +262,8 @@ def run(self) -> bool:
Thank you for submitting a Pull Request (PR) to the LLVM Project. Since this is your first PR, here are a few useful links covering our main contribution policies and review practices.
-* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, please add a note to the PR description.
-* The [LLVM Code-Review Policy and Practices](https://llvm.org/docs/CodeReview.html) document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR
+* All contributions to LLVM must follow our [LLVM AI Tool Use Policy](https://llvm.org/docs/AIToolPolicy.html). In particular, if you used AI while working on this PR, remember to add a note to the PR description.
+* The [LLVM Code-Review Policy and Practices](https://llvm.org/docs/CodeReview.html) document contains practical information about the PR process, including how patches are reviewed and accepted, and who can review a PR.
* Our [LLVM Developer Policy](https://llvm.org/docs/DeveloperPolicy.html) describes our expectations for code quality and commit summaries, your GitHub settings (see e.g. [Email Addresses](https://llvm.org/docs/DeveloperPolicy.html#email-addresses)) and also includes notes on our CI system.
If you have questions, feel free to leave a comment on this PR, or ask on [LLVM Discord](https://discord.com/invite/xS7Z362) or [LLVM Discourse](https://discourse.llvm.org/).
More information about the llvm-commits
mailing list