bin/ci_run_n_monitor: get git sha from pipeline if specified, instead of requiring --rev to match
Fixes: 9ce717ab31
("ci_run_n_monitor: add ability to specify the pipeline to use, instead of auto-detecting it")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24366>
This commit is contained in:

committed by
Marge Bot

parent
f4d24ca414
commit
42021b4d13
@@ -239,13 +239,6 @@ def parse_args() -> None:
|
|||||||
+ '--target ".*traces" ',
|
+ '--target ".*traces" ',
|
||||||
)
|
)
|
||||||
parser.add_argument("--target", metavar="target-job", help="Target job")
|
parser.add_argument("--target", metavar="target-job", help="Target job")
|
||||||
parser.add_argument(
|
|
||||||
"--rev", metavar="revision", help="repository git revision (default: HEAD)"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--pipeline-url",
|
|
||||||
help="URL of the pipeline to use, instead of auto-detecting it.",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--token",
|
"--token",
|
||||||
metavar="token",
|
metavar="token",
|
||||||
@@ -255,6 +248,16 @@ def parse_args() -> None:
|
|||||||
"--force-manual", action="store_true", help="Force jobs marked as manual"
|
"--force-manual", action="store_true", help="Force jobs marked as manual"
|
||||||
)
|
)
|
||||||
parser.add_argument("--stress", action="store_true", help="Stresstest job(s)")
|
parser.add_argument("--stress", action="store_true", help="Stresstest job(s)")
|
||||||
|
|
||||||
|
mutex_group1 = parser.add_mutually_exclusive_group()
|
||||||
|
mutex_group1.add_argument(
|
||||||
|
"--rev", metavar="revision", help="repository git revision (default: HEAD)"
|
||||||
|
)
|
||||||
|
mutex_group1.add_argument(
|
||||||
|
"--pipeline-url",
|
||||||
|
help="URL of the pipeline to use, instead of auto-detecting it.",
|
||||||
|
)
|
||||||
|
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
@@ -289,9 +292,6 @@ if __name__ == "__main__":
|
|||||||
retry_transient_errors=True)
|
retry_transient_errors=True)
|
||||||
|
|
||||||
REV: str = args.rev
|
REV: str = args.rev
|
||||||
if not REV:
|
|
||||||
REV = check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
|
|
||||||
print(f"Revision: {REV}")
|
|
||||||
|
|
||||||
if args.pipeline_url:
|
if args.pipeline_url:
|
||||||
assert args.pipeline_url.startswith(GITLAB_URL)
|
assert args.pipeline_url.startswith(GITLAB_URL)
|
||||||
@@ -303,9 +303,14 @@ if __name__ == "__main__":
|
|||||||
pipeline_id = int(url_path_components[5])
|
pipeline_id = int(url_path_components[5])
|
||||||
cur_project = gl.projects.get(project_name)
|
cur_project = gl.projects.get(project_name)
|
||||||
pipe = cur_project.pipelines.get(pipeline_id)
|
pipe = cur_project.pipelines.get(pipeline_id)
|
||||||
|
REV = pipe.sha
|
||||||
else:
|
else:
|
||||||
cur_project = get_gitlab_project(gl, "mesa")
|
cur_project = get_gitlab_project(gl, "mesa")
|
||||||
|
if not REV:
|
||||||
|
REV = check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
|
||||||
pipe = wait_for_pipeline(cur_project, REV)
|
pipe = wait_for_pipeline(cur_project, REV)
|
||||||
|
|
||||||
|
print(f"Revision: {REV}")
|
||||||
print(f"Pipeline: {pipe.web_url}")
|
print(f"Pipeline: {pipe.web_url}")
|
||||||
|
|
||||||
deps = set()
|
deps = set()
|
||||||
|
Reference in New Issue
Block a user