diff --git a/bin/ci/ci_run_n_monitor.py b/bin/ci/ci_run_n_monitor.py index 4dc4e782a13..778f5fff7fc 100755 --- a/bin/ci/ci_run_n_monitor.py +++ b/bin/ci/ci_run_n_monitor.py @@ -315,10 +315,13 @@ if __name__ == "__main__": pipe = cur_project.pipelines.get(pipeline_id) REV = pipe.sha else: - cur_project = get_gitlab_project(gl, args.project) if not REV: REV = check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip() - pipe = wait_for_pipeline(cur_project, REV) + cur_project = gl.projects.get("mesa/mesa") + pipe = wait_for_pipeline(cur_project, REV, timeout=10) + if not pipe: + cur_project = get_gitlab_project(gl, args.project) + pipe = wait_for_pipeline(cur_project, REV) print(f"Revision: {REV}") print(f"Pipeline: {pipe.web_url}") diff --git a/bin/ci/gitlab_common.py b/bin/ci/gitlab_common.py index 99ebc0e6e17..4b16878e8b0 100644 --- a/bin/ci/gitlab_common.py +++ b/bin/ci/gitlab_common.py @@ -30,13 +30,17 @@ def read_token(token_arg: Optional[str]) -> str: ) -def wait_for_pipeline(project, sha: str): +def wait_for_pipeline(project, sha: str, timeout=None): """await until pipeline appears in Gitlab""" print(f"⏲ for the pipeline to appear in {project.path_with_namespace}..", end="") + start_time = time.time() while True: pipelines = project.pipelines.list(sha=sha) if pipelines: print("", flush=True) return pipelines[0] print("", end=".", flush=True) + if timeout and time.time() - start_time > timeout: + print(" not found", flush=True) + return None time.sleep(1)