Skip to content

Commit 3b09dbe

Browse files
committed
murdock/murdock.py: handle priority label changes
1 parent 37b7d62 commit 3b09dbe

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
@@ -541,14 +541,16 @@ async def handle_pull_request_event(self, event: dict):
541541
return
542542

543543
if action == "labeled":
544-
if event["label"]["name"] != CI_CONFIG.ready_label:
545-
return
546-
# Skip already queued jobs
547-
if event["label"][
548-
"name"
549-
] == CI_CONFIG.ready_label and self.queued.search_by_pr_number(
550-
pull_request.number
551-
):
544+
# return if the ready label was set for an already queued job,
545+
# or if the label wouldn't change the job's priority (and thus
546+
# queue position).
547+
# otherwise, fall through to re-scheduling the job.
548+
label_name = event["label"]["name"]
549+
if label_name == CI_CONFIG.ready_label:
550+
# Skip already queued jobs for ready label
551+
if self.queued.search_by_pr_number(pull_request.number):
552+
return
553+
elif label_name not in config.priorities.labels.keys():
552554
return
553555

554556
await self.schedule_job(job)

0 commit comments

Comments
 (0)