Skip to content

Commit e0bdf18

Browse files
committed
fix broken combined queues
bors.rust-lang.org mentions > Homu provides a few simple ways to customize the queue's contents to fit your needs: > > * queue/rust+cargo will combine the queues of the rust and cargo repos (for example). but it appears 963762a broke this by early aborting to a 404 without checking this case
1 parent f346233 commit e0bdf18

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

homu/server.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def result(repo_label, pull):
117117

118118
@get('/queue/<repo_label:path>')
119119
def queue(repo_label):
120-
if repo_label not in g.cfg['repo'] and repo_label != 'all':
120+
121+
labels = repo_label.split('+')
122+
if repo_label != 'all' \
123+
and any(label not in g.cfg['repo'] for label in labels):
121124
abort(404)
122125

123126
logger = g.logger.getChild('queue')
@@ -126,19 +129,20 @@ def queue(repo_label):
126129

127130
single_repo_closed = None
128131
treeclosed_src = None
132+
repo_url = None
133+
129134
if repo_label == 'all':
130135
labels = g.repos.keys()
131136
multiple = True
132-
repo_url = None
133137
else:
134-
labels = repo_label.split('+')
135138
multiple = len(labels) > 1
136-
if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0:
137-
single_repo_closed = g.repos[repo_label].treeclosed
138-
treeclosed_src = g.repos[repo_label].treeclosed_src
139-
repo_url = 'https://github.com/{}/{}'.format(
140-
g.cfg['repo'][repo_label]['owner'],
141-
g.cfg['repo'][repo_label]['name'])
139+
if not multiple:
140+
if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0:
141+
single_repo_closed = g.repos[repo_label].treeclosed
142+
treeclosed_src = g.repos[repo_label].treeclosed_src
143+
repo_url = 'https://github.com/{}/{}'.format(
144+
g.cfg['repo'][repo_label]['owner'],
145+
g.cfg['repo'][repo_label]['name'])
142146

143147
states = []
144148
for label in labels:

0 commit comments

Comments
 (0)