[llvm] 38e9006 - Include the issue description in the subscription comment so that email notification is self-contained (#65839)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 22:39:05 PDT 2023
Author: Mehdi Amini
Date: 2023-09-11T22:39:01-07:00
New Revision: 38e9006896edf89200102bc8ad4d9167e9a535a9
URL: https://github.com/llvm/llvm-project/commit/38e9006896edf89200102bc8ad4d9167e9a535a9
DIFF: https://github.com/llvm/llvm-project/commit/38e9006896edf89200102bc8ad4d9167e9a535a9.diff
LOG: Include the issue description in the subscription comment so that email notification is self-contained (#65839)
This makes it so that we don't need to open the issue to have the
description in our inbox on subscription.
Added:
Modified:
llvm/utils/git/github-automation.py
Removed:
################################################################################
diff --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index 7df20ea8457155b..c4c4848fbc5f8bc 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -39,6 +39,13 @@
"""
+def _get_curent_team(team_name, teams) -> Optional[github.Team.Team]:
+ for team in teams:
+ if team_name == team.name.lower():
+ return team
+ return None
+
+
class IssueSubscriber:
@property
def team_name(self) -> str:
@@ -51,18 +58,23 @@ def __init__(self, token: str, repo: str, issue_number: int, label_name: str):
self._team_name = "issue-subscribers-{}".format(label_name).lower()
def run(self) -> bool:
- for team in self.org.get_teams():
- if self.team_name != team.name.lower():
- continue
+ team = _get_curent_team(self.team_name, self.org.get_teams())
+ if not team:
+ print(f"couldn't find team named {self.team_name}")
+ return False
+ comment = ""
+ if team.slug == "issue-subscribers-good-first-issue":
+ comment = "{}\n".format(beginner_comment)
- comment = ""
- if team.slug == "issue-subscribers-good-first-issue":
- comment = "{}\n".format(beginner_comment)
+ comment = (
+ f"@llvm/{team.slug}"
+ + "\n\n<details>\n"
+ + f"{self.issue.body}\n"
+ + "</details>"
+ )
- comment += "@llvm/{}".format(team.slug)
- self.issue.create_comment(comment)
- return True
- return False
+ self.issue.create_comment(comment)
+ return True
def human_readable_size(size, decimal_places=2):
@@ -86,7 +98,7 @@ def __init__(self, token: str, repo: str, pr_number: int, label_name: str):
def run(self) -> bool:
patch = None
- team = self._get_curent_team()
+ team = _get_curent_team(self.team_name, self.org.get_teams())
if not team:
print(f"couldn't find team named {self.team_name}")
return False
More information about the llvm-commits
mailing list