ci_run_n_monitor: add method to get a pipeline job by its id

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27499>
This commit is contained in:
Eric Engestrom
2024-02-07 16:43:29 +00:00
committed by Marge Bot
parent bce1230587
commit 5bc1a62fbb

View File

@@ -191,6 +191,14 @@ def monitor_pipeline(
pretty_wait(REFRESH_WAIT_JOBS)
def get_pipeline_job(
pipeline: gitlab.v4.objects.ProjectPipeline,
id: int,
) -> gitlab.v4.objects.ProjectPipelineJob:
pipeline_jobs = pipeline.jobs.list(all=True)
return [j for j in pipeline_jobs if j.id == id][0]
def enable_job(
project: gitlab.v4.objects.Project,
pipeline: gitlab.v4.objects.ProjectPipeline,