From 467dd0b990c1b305d48ec2269e8cee681b6840bb Mon Sep 17 00:00:00 2001 From: Sergi Blanch Torne Date: Sat, 20 Dec 2025 11:15:10 +0100 Subject: [PATCH] ci,crnm: warning message when a job can't be enabled Instead of an exception that completely stops the run'n'monitor process, when a job with a specific status can't be enabled, just log it with a warning. Don't attempt to enable it again unless it changes the status. Signed-off-by: Sergi Blanch Torne Part-of: --- bin/ci/ci_run_n_monitor.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/ci/ci_run_n_monitor.py b/bin/ci/ci_run_n_monitor.py index 791ab6c29f4..76e112e39af 100755 --- a/bin/ci/ci_run_n_monitor.py +++ b/bin/ci/ci_run_n_monitor.py @@ -302,11 +302,17 @@ def enable_job( # Get current attempt number attempt_count = enable_attempts.get((job.id, job.status), 0) # Check if we've exceeded max attempts to avoid infinite loop - if attempt_count >= MAX_ENABLE_JOB_ATTEMPTS: - raise RuntimeError( + if attempt_count == MAX_ENABLE_JOB_ATTEMPTS: + print( + f"[yellow]WARNING: " f"Maximum enabling attempts ({MAX_ENABLE_JOB_ATTEMPTS}) reached for job {job.name} in {job.status} status" - f"({link2print(job.web_url, job.id)}). Giving up." + f"({link2print(job.web_url, job.id)})." ) + enable_attempts[(job.id, job.status)] = attempt_count + 1 + return False + elif attempt_count > MAX_ENABLE_JOB_ATTEMPTS: + return False + enable_attempts[(job.id, job.status)] = attempt_count + 1 pjob = project.jobs.get(job.id, lazy=True)