From 3248b12631177e405efdc0aca75a913e7ed86a85 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Tue, 25 Oct 2022 12:11:00 +0200 Subject: [PATCH] Avoid requesting further comments if there's already one failure If there's already one failing openQA job blocking the approval we don't need to check further openQA jobs as the incident is blocked anyways. Related ticket: https://progress.opensuse.org/issues/107923 --- openqabot/approver.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openqabot/approver.py b/openqabot/approver.py index 62f6ed9..b46dd8d 100644 --- a/openqabot/approver.py +++ b/openqabot/approver.py @@ -108,13 +108,17 @@ def get_jobs(self, job: JobAggr, api: str, inc: int) -> bool: # keep jobs explicitly marked as acceptable for this incident by openQA comments for res in results: - not_ok_job = res["status"] != "passed" - if not_ok_job and self.is_job_marked_acceptable_for_incident(job, inc): + ok_job = res["status"] == "passed" + if ok_job: + continue + if self.is_job_marked_acceptable_for_incident(job, inc): logger.info( "Ignoring failed job %s for incident %s due to openQA comment" % (job.job_id, inc) ) res["status"] = "passed" + else: + break if not results: raise NoResultsError("Job %s not found " % str(job.job_id))