[llvm] [GitHub] Add Greeting comment to new PRs with useful information (PR #72249)

Kristof Beyls via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 06:53:38 PST 2023


================
@@ -211,6 +211,35 @@ def _get_curent_team(self) -> Optional[github.Team.Team]:
         return None
 
 
+class PRGreeter:
+    def __init__(self, token: str, repo: str, pr_number: int):
+        repo = github.Github(token).get_repo(repo)
+        self.pr = repo.get_issue(pr_number).as_pull_request()
+
+    def run(self) -> bool:
+        # We assume that this is only called for a PR that has just been opened.
+
+        # This text is using Markdown formatting.
+        comment = f"""\
----------------
kbeyls wrote:

The comment content in proposed in the PR right now seems geared towards new (or the very occasional) contributor. Therefore, it would be best to only put this on PRs created by those type of contributors.
I guess that one heuristic to cover "very occasional" contributor could be to put this on every PR where the contributor hasn't contributed to LLVM in e.g. a year? Or the first PR for that contributor this year (which would result in frequent contributors seeing this once per year)?



https://github.com/llvm/llvm-project/pull/72249


More information about the llvm-commits mailing list