Implemented gitlab-pipeline GitLab delegation job in Zuul
The zuul-config repo now defines a gitlab-pipeline job that shows how we can delegate control of the CI workflow back to GitLab from Zuul so that projects can self-serve their own CI in the canonical GitLab way while still benefiting from Zuul functions such as speculative repo state and gating.
The job is started on zuul-executor and requires no nodepool, making for minimal startup latency. It interacts solely with the GitLab API to:
- Resolve MR details such as the source branch.
- Create a CI pipeline for the source branch. The pipeline becomes associated with the MR in GitLab automatically and displays in the UI just as any normal MR triggered pipeline.
- Passes the Zuul Build UUID to the pipeline so that it can retrieve speculative state source files (with dependencies) over rsync instead of cloning from the GitLab repo.
- Waits on the GitLab pipeline to complete.
- Fails or succeeds according to the pipeline status.
See repos/test-project/.gitlab-ci.yml
for the project config needed to
handle Zuul triggered pipelines.
Bug: T350288