Module: Mesa
Branch: main
Commit: 29990912877df91d3854bc10710cfe3974a8b935
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=29990912877df91d3854bc10710cfe3974a8b935

Author: Helen Koike <[email protected]>
Date:   Fri Nov 10 18:41:42 2023 -0300

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26155>

---

 bin/ci/ci_run_n_monitor.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bin/ci/ci_run_n_monitor.py b/bin/ci/ci_run_n_monitor.py
index 4c14d1d5a7a..20e9798ad99 100755
--- a/bin/ci/ci_run_n_monitor.py
+++ b/bin/ci/ci_run_n_monitor.py
@@ -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
 

Reply via email to