Skip to content

Commit 69f5fd1

Browse files
committed
Command parser: allow @bors:
Commands that started with the botname *and then a colon* were being dropped, because the parser didn't recognize the command and didn't continue. Fix this by explicitely allowing a colon after the botname.
1 parent dc435f6 commit 69f5fd1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

homu/parse_issue_comment.py

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ def parse_issue_comment(username, body, sha, botname, hooks=[]):
174174
if word == '@' + botname:
175175
continue
176176

177+
if word == '@' + botname + ':':
178+
continue
179+
177180
if word == 'r+' or word.startswith('r='):
178181
approved_sha = sha
179182

homu/tests/test_parse_issue_comment.py

+16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ def test_r_plus():
2121
assert command.actor == 'jack'
2222

2323

24+
def test_r_plus_with_colon():
25+
"""
26+
@bors: r+
27+
"""
28+
29+
author = "jack"
30+
body = "@bors: r+"
31+
commands = parse_issue_comment(author, body, commit, "bors")
32+
33+
assert len(commands) == 1
34+
command = commands[0]
35+
assert command.action == 'approve'
36+
assert command.actor == 'jack'
37+
assert command.commit == commit
38+
39+
2440
def test_r_plus_with_sha():
2541
"""
2642
@bors r+ {sha}

0 commit comments

Comments
 (0)