mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 18:24:13 +08:00
ci/bin: Fix gitlab_gql methods that uses needs DAG
Some gitlab_gql.py features like `--print-dag` were affected by recent
changes. Update those functions with the refactored data.
Fixes: c7b67d8619
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25940>
This commit is contained in:
parent
278fc1c22a
commit
b87e092489
@ -460,6 +460,12 @@ def get_job_final_definition(job_name, merged_yaml, project_path, sha):
|
||||
print(image)
|
||||
|
||||
|
||||
def from_sha_to_pipeline_iid(gl_gql: GitlabGQL, params) -> str:
|
||||
result = gl_gql.query("pipeline_utils.gql", params)
|
||||
|
||||
return result["project"]["pipelines"]["nodes"][0]["iid"]
|
||||
|
||||
|
||||
def parse_args() -> Namespace:
|
||||
parser = ArgumentParser(
|
||||
formatter_class=ArgumentDefaultsHelpFormatter,
|
||||
@ -499,10 +505,11 @@ def parse_args() -> Namespace:
|
||||
def main():
|
||||
args = parse_args()
|
||||
gl_gql = GitlabGQL(token=args.gitlab_token)
|
||||
args.iid = from_sha_to_pipeline_iid(gl_gql, {"projectPath": args.project_path, "sha": args.sha})
|
||||
|
||||
if args.print_dag:
|
||||
dag, jobs = create_job_needs_dag(
|
||||
gl_gql, {"projectPath": args.project_path, "sha": args.sha}
|
||||
dag = create_job_needs_dag(
|
||||
gl_gql, {"projectPath": args.project_path, "iid": args.iid}, disable_cache=True
|
||||
)
|
||||
|
||||
if args.regex:
|
||||
|
9
bin/ci/pipeline_utils.gql
Normal file
9
bin/ci/pipeline_utils.gql
Normal file
@ -0,0 +1,9 @@
|
||||
query sha2pipelineIID($projectPath: ID!, $sha: String!) {
|
||||
project(fullPath: $projectPath) {
|
||||
pipelines(last: 1, sha:$sha){
|
||||
nodes {
|
||||
iid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user