Skip to content

Commit fdee225

Browse files
authored
KAFKA-17177 reviewers.py should grep "authors" to offer more candidates of reviewers information (#16674)
Reviewers: Chia-Ping Tsai <[email protected]>
1 parent da8fe63 commit fdee225

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

reviewers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ def prompt_for_user():
3838
if __name__ == "__main__":
3939
print("Utility to help generate 'Reviewers' string for Pull Requests. Use Ctrl+D or Ctrl+C to exit")
4040

41-
stream = os.popen("git log | grep Reviewers")
41+
command = r"git log | grep 'Reviewers\|Author'"
42+
stream = os.popen(command)
4243
lines = stream.readlines()
4344
all_reviewers = defaultdict(int)
4445
for line in lines:
45-
stripped = line.strip().lstrip("Reviewers: ")
46+
stripped = line.strip().lstrip("Reviewers: ").lstrip("Author: ")
4647
reviewers = stripped.split(",")
4748
for reviewer in reviewers:
4849
all_reviewers[reviewer.strip()] += 1
4950
parsed_reviewers = []
5051

5152
for item in all_reviewers.items():
52-
m = re.match("(?P<name>.*)\s<(?P<email>.*)>", item[0])
53+
patterns = r"(?P<name>.*)\s<(?P<email>.*)>"
54+
m = re.match(patterns, item[0])
5355
if m is not None and len(m.groups()) == 2:
5456
if item[1] > 2:
5557
parsed_reviewers.append((m.group("name"), m.group("email"), item[1]))

0 commit comments

Comments
 (0)