From a0de5e7d0258a10e7b766fd9202576a3a3e34400 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Thu, 16 Jan 2025 11:36:47 +0100 Subject: [PATCH] ci: Fix trace update script reading GitLab token from default location Update the trace update script to use get_token_from_default_dir for reading the GitLab token from the default location (~/.config/gitlab-token), fixing the script and aligning it with our other tools. Signed-off-by: Valentine Burley Part-of: --- bin/ci/update_traces_checksum.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/ci/update_traces_checksum.py b/bin/ci/update_traces_checksum.py index b62556d441d..f050c8f6e51 100755 --- a/bin/ci/update_traces_checksum.py +++ b/bin/ci/update_traces_checksum.py @@ -20,7 +20,8 @@ from ruamel.yaml import YAML import gitlab from colorama import Fore, Style -from gitlab_common import get_gitlab_project, read_token, wait_for_pipeline, get_gitlab_pipeline_from_url +from gitlab_common import (get_gitlab_project, read_token, wait_for_pipeline, + get_gitlab_pipeline_from_url, TOKEN_DIR, get_token_from_default_dir) DESCRIPTION_FILE = "export PIGLIT_REPLAY_DESCRIPTION_FILE=.*/install/(.*)$" @@ -122,7 +123,10 @@ def parse_args() -> None: parser.add_argument( "--token", metavar="token", - help="force GitLab token, otherwise it's read from ~/.config/gitlab-token", + type=str, + default=get_token_from_default_dir(), + help="Use the provided GitLab token or token file, " + f"otherwise it's read from {TOKEN_DIR / 'gitlab-token'}", ) parser.add_argument( "--pipeline-url",