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

Author: Eric Engestrom <[email protected]>
Date:   Fri Nov 10 10:47:56 2023 +0000

bin/gitlab_gql: only get the pipeline when a pipeline is needed

Otherwise, options like --print-merged-yaml are broken when their
commit's push didn't create a pipeline.

Fixes: b87e092489037daf45a5 ("ci/bin: Fix gitlab_gql methods that uses needs 
DAG")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26142>

---

 bin/ci/gitlab_gql.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bin/ci/gitlab_gql.py b/bin/ci/gitlab_gql.py
index 86cd6d6f7db..f4c76a947fc 100755
--- a/bin/ci/gitlab_gql.py
+++ b/bin/ci/gitlab_gql.py
@@ -509,11 +509,10 @@ def main():
 
     sha = check_output(['git', 'rev-parse', args.sha]).decode('ascii').strip()
 
-    args.iid = from_sha_to_pipeline_iid(gl_gql, {"projectPath": 
args.project_path, "sha": sha})
-
     if args.print_dag:
+        iid = from_sha_to_pipeline_iid(gl_gql, {"projectPath": 
args.project_path, "sha": sha})
         dag = create_job_needs_dag(
-            gl_gql, {"projectPath": args.project_path, "iid": args.iid}, 
disable_cache=True
+            gl_gql, {"projectPath": args.project_path, "iid": iid}, 
disable_cache=True
         )
 
         if args.regex:

Reply via email to