Skip to content
This repository was archived by the owner on Mar 14, 2023. It is now read-only.

Commit 0932999

Browse files
authored
split libs review rotation in two (#389)
Add mention message for authors to categorize their own PRs Update message and fix trailing cc remove unnecessary trailing newlines Add thomcc to review rotation as well
1 parent c935ec3 commit 0932999

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

highfive/configs/rust-lang/rust.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@
2323
"compiler-team-contributors"
2424
],
2525
"libs": [
26-
"@dtolnay",
2726
"@joshtriplett",
2827
"@Mark-Simulacrum",
2928
"@kennytm",
3029
"@yaahc",
3130
"@m-ou-se",
3231
"@thomcc"
3332
],
33+
"libs-api": [
34+
"@dtolnay",
35+
"@joshtriplett",
36+
"@yaahc",
37+
"@m-ou-se"
38+
],
3439
"infra-ci": [
3540
"@Mark-Simulacrum",
3641
"@kennytm",
@@ -192,6 +197,10 @@
192197
"src/tools/miri": {
193198
"message": "Some changes occured to the Miri submodule",
194199
"reviewers": ["@rust-lang/miri"]
200+
},
201+
"library": {
202+
"message": "Thank you for submitting a new PR for the library teams! If this PR contains a stabilization of a library feature that has not already completed FCP in its tracking issue, introduces new or changes existing unstable library APIs, or changes our public documentation in ways that create new stability guarantees then please comment with `r? rust-lang/libs-api @rustbot label +T-libs-api` to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary",
203+
"reviewers": []
195204
}
196205
},
197206
"new_pr_labels": ["S-waiting-on-review"]

highfive/newpr.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,19 @@ def run_commands(self, to_mention, owner, repo, issue, user):
129129
if len(message) > 0:
130130
message += '\n\n'
131131
msg = mention.get('message')
132+
reviewers = [x for x in mention['reviewers'] if x != user]
133+
132134
if msg is not None:
133-
msg += '\n\n'
135+
if len(reviewers) > 0:
136+
msg += '\n\n'
134137
else:
135138
msg = ''
136-
message += "%scc %s" % (msg, ','.join([x for x in mention['reviewers'] if x != user]))
139+
140+
if len(reviewers) > 0:
141+
message += "%scc %s" % (msg, ','.join(reviewers))
142+
else:
143+
message += msg
144+
137145
cmd = mention.get('command')
138146
if cmd is not None:
139147
commands[cmd] = self.payload['pull_request', 'head', 'sha']

highfive/tests/test_newpr.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,16 @@ def test_has_to_mention(self):
564564
'message': 'Also important',
565565
'reviewers': ['@userD'],
566566
},
567+
{
568+
'message': 'last message but this one has nobody to mention associated with it',
569+
'reviewers': [],
570+
},
567571
]
568572
self.set_assignee(to_mention=to_mention)
569573

570574
self.assert_api_req_call()
571575
self.mocks['post_comment'].assert_called_once_with(
572-
'This is important\n\ncc @userA,@userB,@userC\n\nAlso important\n\ncc @userD',
576+
'This is important\n\ncc @userA,@userB,@userC\n\nAlso important\n\ncc @userD\n\nlast message but this one has nobody to mention associated with it',
573577
self.owner, self.repo, self.issue
574578
)
575579

0 commit comments

Comments
 (0)