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

split libs review rotation in two #389

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion highfive/configs/rust-lang/rust.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,19 @@
"compiler-team-contributors"
],
"libs": [
"@dtolnay",
"@joshtriplett",
"@Mark-Simulacrum",
"@kennytm",
"@yaahc",
"@m-ou-se",
"@thomcc"
],
"libs-api": [
"@dtolnay",
"@joshtriplett",
"@yaahc",
"@m-ou-se"
],
"infra-ci": [
"@Mark-Simulacrum",
"@kennytm",
Expand Down Expand Up @@ -192,6 +197,10 @@
"src/tools/miri": {
"message": "Some changes occured to the Miri submodule",
"reviewers": ["@rust-lang/miri"]
},
"library": {
"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",
"reviewers": []
}
},
"new_pr_labels": ["S-waiting-on-review"]
Expand Down
12 changes: 10 additions & 2 deletions highfive/newpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,19 @@ def run_commands(self, to_mention, owner, repo, issue, user):
if len(message) > 0:
message += '\n\n'
msg = mention.get('message')
reviewers = [x for x in mention['reviewers'] if x != user]

if msg is not None:
msg += '\n\n'
if len(reviewers) > 0:
msg += '\n\n'
else:
msg = ''
message += "%scc %s" % (msg, ','.join([x for x in mention['reviewers'] if x != user]))

if len(reviewers) > 0:
message += "%scc %s" % (msg, ','.join(reviewers))
else:
message += msg

cmd = mention.get('command')
if cmd is not None:
commands[cmd] = self.payload['pull_request', 'head', 'sha']
Expand Down
6 changes: 5 additions & 1 deletion highfive/tests/test_newpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,16 @@ def test_has_to_mention(self):
'message': 'Also important',
'reviewers': ['@userD'],
},
{
'message': 'last message but this one has nobody to mention associated with it',
'reviewers': [],
},
]
self.set_assignee(to_mention=to_mention)

self.assert_api_req_call()
self.mocks['post_comment'].assert_called_once_with(
'This is important\n\ncc @userA,@userB,@userC\n\nAlso important\n\ncc @userD',
'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',
self.owner, self.repo, self.issue
)

Expand Down