summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEric Engestrom <eric@igalia.com>2023-11-06 16:26:22 +0000
committerMarge Bot <emma+marge@anholt.net>2023-12-14 12:06:39 +0000
commitdb6541a41a27a3695771ad061fb69dbe7f14a5cf (patch)
treedc683e446368d464770aef8e645bc93efcabd687 /bin
parent6a92af158dc132eee449c175bdee66d92c68d191 (diff)
bin/gitlab_gql: fix --print-merged-yaml when --rev != HEAD
Reading the local root config file and then asking gitlab to evaluate it in the context of some other version will cause issues if they are not identical. Instead, the local document should be a simple include of whatever is the root config file at that commit. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26074>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ci/gitlab_gql.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/ci/gitlab_gql.py b/bin/ci/gitlab_gql.py
index 3f422d5d10a..64d44f09678 100755
--- a/bin/ci/gitlab_gql.py
+++ b/bin/ci/gitlab_gql.py
@@ -12,6 +12,7 @@ from itertools import accumulate
from os import getenv
from pathlib import Path
from subprocess import check_output
+from textwrap import dedent
from typing import Any, Iterable, Optional, Pattern, TypedDict, Union
import yaml
@@ -349,9 +350,10 @@ def print_dag(dag: Dag) -> None:
def fetch_merged_yaml(gl_gql: GitlabGQL, params) -> dict[str, Any]:
- gitlab_yml_file = get_project_root_dir() / ".gitlab-ci.yml"
- content = Path(gitlab_yml_file).read_text().strip()
- params["content"] = content
+ params["content"] = dedent("""\
+ include:
+ - local: .gitlab-ci.yml
+ """)
raw_response = gl_gql.query("job_details.gql", params)
if merged_yaml := raw_response["ciConfig"]["mergedYaml"]:
return yaml.safe_load(merged_yaml)