Skip to content

Commit ffad7aa

Browse files
authored
Merge pull request #94 from Manishearth/iffy
Add rollup=iffy, sort by rollup status
2 parents 9f17496 + adfc775 commit ffad7aa

File tree

6 files changed

+39
-24
lines changed

6 files changed

+39
-24
lines changed

homu/html/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ <h3>Commands</h3>
4646
<li><code>r=NAME (SHA)</code>: Accept a PR on the behalf of NAME.</li>
4747
<li><code>r-</code>: Unacccept a PR.</li>
4848
<li><code>p=NUMBER</code>: Set the priority of the accepted PR (defaults to 0).</li>
49-
<li><code>rollup</code>: Mark the PR as likely to merge without issue, implies <code>p=-1.</code></li>
49+
<li><code>rollup</code>: Mark the PR as likely to merge without issue, short for <code>rollup=always</code></li>
5050
<li><code>rollup-</code>: Unmark the PR as <code>rollup</code>.</li>
51-
<li><code>rollup=maybe|always|never</code>: Mark the PR as "always", "maybe", and "never" rollup-able.</li>
51+
<li><code>rollup=maybe|always|iffy|never</code>: Mark the PR as "always", "maybe", "iffy", and "never" rollup-able.</li>
5252
<li><code>retry</code>: Signal that the PR is not bad, and should be retried by buildbot.</li>
5353
<li><code>try</code>: Request that the PR be tested by buildbot, without accepting it.</li>
5454
<li><code>force</code>: Stop all the builds on the configured builders, and proceed to the next PR.</li>

homu/html/queue.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@
9494
border-color: #ab0a0a;
9595
}
9696

97+
.rollup_iffy {
98+
color: #D9C009;
99+
}
100+
.rollup_iffy:before {
101+
background: #F0DE57;
102+
border-color: #D9C009;
103+
}
104+
97105
.sorting_asc:after { content: " ▲"; }
98106
.sorting_desc:after { content: " ▼"; }
99107
.dataTables_filter, .dataTables_info, .dataTables_empty { display: none; }

homu/main.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@
4141

4242
global_cfg = {}
4343

44-
WORDS_TO_ROLLUP = {
45-
'rollup-': 0,
46-
'rollup': 1,
47-
'rollup=maybe': 0,
48-
'rollup=never': -1,
49-
'rollup=always': 1,
50-
}
51-
5244

5345
@contextmanager
5446
def buildbot_sess(repo_cfg):
@@ -182,10 +174,8 @@ def sort_key(self):
182174
STATUS_TO_PRIORITY.get(self.get_status(), -1),
183175
1 if self.mergeable is False else 0,
184176
0 if self.approved_by else 1,
185-
# Sort rollup=always to the bottom of the queue, but treat all
186-
# other rollup statuses as equivalent
187-
1 if WORDS_TO_ROLLUP['rollup=always'] == self.rollup else 0,
188177
-self.priority,
178+
self.rollup,
189179
self.num,
190180
]
191181

homu/parse_issue_comment.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
from itertools import chain
22
import re
33

4+
WORDS_TO_ROLLUP = {
5+
'rollup-': 0,
6+
'rollup': 1,
7+
'rollup=maybe': 0,
8+
'rollup=never': -2,
9+
'rollup=iffy': -1,
10+
'rollup=always': 1,
11+
}
12+
413

514
class IssueCommentCommand:
615
"""
@@ -93,15 +102,6 @@ def hook(cls, hook_name, hook_extra=None):
93102
return command
94103

95104

96-
WORDS_TO_ROLLUP = {
97-
'rollup-': 0,
98-
'rollup': 1,
99-
'rollup=maybe': 0,
100-
'rollup=never': -1,
101-
'rollup=always': 1,
102-
}
103-
104-
105105
def is_sha(sha):
106106
"""
107107
Try to determine if the input is a git sha

homu/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class G:
4343

4444
g = G()
4545

46+
4647
ROLLUP_STR = {
47-
-1: 'never',
48+
-2: 'never',
49+
-1: 'iffy',
4850
0: '',
4951
1: 'always',
5052
}

homu/tests/test_parse_issue_comment.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,21 @@ def test_rollup_minus():
299299
assert command.rollup_value == 0
300300

301301

302+
def test_rollup_iffy():
303+
"""
304+
@bors rollup=iffy
305+
"""
306+
307+
author = "manishearth"
308+
body = "@bors rollup=iffy"
309+
commands = parse_issue_comment(author, body, commit, "bors")
310+
311+
assert len(commands) == 1
312+
command = commands[0]
313+
assert command.action == 'rollup'
314+
assert command.rollup_value == -1
315+
316+
302317
def test_rollup_never():
303318
"""
304319
@bors rollup=never
@@ -311,7 +326,7 @@ def test_rollup_never():
311326
assert len(commands) == 1
312327
command = commands[0]
313328
assert command.action == 'rollup'
314-
assert command.rollup_value == -1
329+
assert command.rollup_value == -2
315330

316331

317332
def test_rollup_maybe():

0 commit comments

Comments
 (0)