Skip to content

Commit

Permalink
fix broken combined queues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Skgland committed Feb 18, 2022
1 parent f346233 commit e0bdf18
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions homu/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def result(repo_label, pull):

@get('/queue/<repo_label:path>')
def queue(repo_label):
if repo_label not in g.cfg['repo'] and repo_label != 'all':

labels = repo_label.split('+')
if repo_label != 'all' \
and any(label not in g.cfg['repo'] for label in labels):
abort(404)

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

single_repo_closed = None
treeclosed_src = None
repo_url = None

if repo_label == 'all':
labels = g.repos.keys()
multiple = True
repo_url = None
else:
labels = repo_label.split('+')
multiple = len(labels) > 1
if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0:
single_repo_closed = g.repos[repo_label].treeclosed
treeclosed_src = g.repos[repo_label].treeclosed_src
repo_url = 'https://github.com/{}/{}'.format(
g.cfg['repo'][repo_label]['owner'],
g.cfg['repo'][repo_label]['name'])
if not multiple:
if repo_label in g.repos and g.repos[repo_label].treeclosed >= 0:
single_repo_closed = g.repos[repo_label].treeclosed
treeclosed_src = g.repos[repo_label].treeclosed_src
repo_url = 'https://github.com/{}/{}'.format(
g.cfg['repo'][repo_label]['owner'],
g.cfg['repo'][repo_label]['name'])

states = []
for label in labels:
Expand Down

0 comments on commit e0bdf18

Please sign in to comment.