Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid requesting further comments if there's already one failure #82

Merged
merged 1 commit into from Oct 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions openqabot/approver.py
Expand Up @@ -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))
Expand Down