diff options
author | Eric Engestrom <eric@igalia.com> | 2023-11-27 17:47:58 +0000 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-12-03 11:28:49 +0000 |
commit | 76be39ca6dbcfb62f1ef5194661c765cc97620c7 (patch) | |
tree | cdb5e149898ca5527d5034593f2be2a138173ea7 /bin | |
parent | ed53147a7fbe3cc9029c414533c8b3347f2f7289 (diff) |
ci_run_n_monitor: allow picking a pipeline by its MR
It picks the latest pipeline from the MR; if you want another pipeline,
use `--pipeline-url`.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26381>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ci/ci_run_n_monitor.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/ci/ci_run_n_monitor.py b/bin/ci/ci_run_n_monitor.py index 20e9798ad99..0ef46c4f453 100755 --- a/bin/ci/ci_run_n_monitor.py +++ b/bin/ci/ci_run_n_monitor.py @@ -298,6 +298,11 @@ def parse_args() -> None: "--pipeline-url", help="URL of the pipeline to use, instead of auto-detecting it.", ) + mutex_group1.add_argument( + "--mr", + type=int, + help="ID of a merge request; the latest pipeline in that MR will be used.", + ) args = parser.parse_args() @@ -372,11 +377,14 @@ if __name__ == "__main__": pipe = cur_project.pipelines.get(pipeline_id) REV = pipe.sha else: - REV = check_output(['git', 'rev-parse', REV]).decode('ascii').strip() - mesa_project = gl.projects.get("mesa/mesa") - user_project = get_gitlab_project(gl, args.project) - (pipe, cur_project) = wait_for_pipeline([mesa_project, user_project], REV) + projects = [mesa_project] + if args.mr: + REV = mesa_project.mergerequests.get(args.mr).sha + else: + REV = check_output(['git', 'rev-parse', REV]).decode('ascii').strip() + projects.append(get_gitlab_project(gl, args.project)) + (pipe, cur_project) = wait_for_pipeline(projects, REV) print(f"Revision: {REV}") print(f"Pipeline: {pipe.web_url}") |