Skip to content

Commit 39bc4ba

Browse files
Add a link to the queue when posting approval for PR
This should help new users with knowing what to do after an r+ has been posted (i.e., that the PR is in queue).
1 parent 592ac09 commit 39bc4ba

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

homu/comments.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, bot=None, **args):
2828
super().__init__(**args)
2929
self.bot = bot
3030

31-
params = ["sha", "approver"]
31+
params = ["sha", "approver", "queue"]
3232

3333
def render(self):
3434
# The comment here is required because Homu wants a full, unambiguous,
@@ -37,11 +37,13 @@ def render(self):
3737
# reloads and another commit has been pushed since the approval.
3838
message = ":pushpin: Commit {sha} has been " + \
3939
"approved by `{approver}`\n\n" + \
40+
"It is now in the [queue]({queue}) for this repository.\n\n" + \
4041
"<!-- @{bot} r={approver} {sha} -->"
4142
return message.format(
4243
sha=self.sha,
4344
approver=self.approver,
44-
bot=self.bot
45+
bot=self.bot,
46+
queue=self.queue
4547
)
4648

4749

homu/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ def parse_commands(body, username, user_id, repo_label, repo_cfg, state,
603603
sha=state.head_sha,
604604
approver=approver,
605605
bot=my_username,
606+
queue="https://bors.rust-lang.org/homu/queue/{}"
607+
.format(repo_label)
606608
))
607609
treeclosed, treeclosed_src = state.blocked_by_closed_tree()
608610
if treeclosed:

homu/tests/test_parse_issue_comment.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def test_hidden_r_equals():
8787
author = "bors"
8888
body = """
8989
:pushpin: Commit {0} has been approved by `jack`
90+
It is now in the [queue]({1}) for this repository.\n\n
9091
<!-- @bors r=jack {0} -->
91-
""".format(commit)
92+
""".format(commit, "rust")
9293

9394
commands = parse_issue_comment(author, body, commit, "bors")
9495

0 commit comments

Comments
 (0)