Skip to content

Commit 42b1066

Browse files
committed
murdock/murdock.py: handle priority label changes
1 parent 635a967 commit 42b1066

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

murdock/murdock.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,16 @@ async def handle_pull_request_event(self, event: dict):
468468
return
469469

470470
if action == "labeled":
471-
if event["label"]["name"] != CI_CONFIG.ready_label:
472-
return
473-
# Skip already queued jobs
474-
if event["label"][
475-
"name"
476-
] == CI_CONFIG.ready_label and self.queued.search_by_pr_number(
477-
pull_request.number
478-
):
471+
# return if the ready label was set for an already queued job,
472+
# or if the label wouldn't change the job's priority (and thus
473+
# queue position).
474+
# otherwise, fall through to re-scheduling the job.
475+
label_name = event["label"]["name"]
476+
if label_name == CI_CONFIG.ready_label:
477+
# Skip already queued jobs for ready label
478+
if self.queued.search_by_pr_number(pull_request.number):
479+
return
480+
elif label_name not in config.priorities.labels.keys():
479481
return
480482

481483
await self.schedule_job(job)

0 commit comments

Comments
 (0)