ci/ci_run_n_monitor: abort when target gets skipped

when a target receives skipped state it is because some of the
dependencies failed, abort the script and print the reason

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26155>
This commit is contained in:
Helen Koike 2023-11-10 18:41:42 -03:00 committed by Marge Bot
parent 3d53022e68
commit 2999091287
1 changed files with 15 additions and 0 deletions

View File

@ -102,6 +102,7 @@ def monitor_pipeline(
target_id = None
while True:
deps_failed = []
to_cancel = []
for job in pipeline.jobs.list(all=True, sort="desc"):
# target jobs
@ -130,6 +131,8 @@ def monitor_pipeline(
# run dependencies and cancel the rest
if job.name in dependencies:
enable_job(project, job, "dep", True)
if job.status == "failed":
deps_failed.append(job.name)
else:
to_cancel.append(job)
@ -164,6 +167,18 @@ def monitor_pipeline(
):
return None, 1
if (
{"skipped"}.intersection(target_statuses.values())
and not {"running", "pending"}.intersection(target_statuses.values())
):
print(
Fore.RED,
"Target in skipped state, aborting. Failed dependencies:",
deps_failed,
Fore.RESET,
)
return None, 1
if {"success", "manual"}.issuperset(target_statuses.values()):
return None, 0