Skip to content
  • Dduvall's avatar
    Implemented gitlab-pipeline GitLab delegation job in Zuul · 452f5d38
    Dduvall authored
    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:
    
     1. Resolve MR details such as the source branch.
     2. 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.
     3. 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.
     4. Waits on the GitLab pipeline to complete.
     5. 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
    452f5d38