Skip to content

Add downstream_pipeline field to JobType

Laura Montemayor requested to merge lm-add-downstream-pipeline-to-job-type into master

What does this MR do and why?

This is needed in order to unblock: !76853 (merged)

query:

{
  project(fullPath: "root/downstream-pipeline-project") {
    pipeline(iid: "13") {
      jobs {
        nodes {
          downstreamPipeline {
            id
            path
          }
        }
      }
    }
  }
}

response:

{
  "data": {
    "project": {
      "pipeline": {
        "jobs": {
          "nodes": [
            {
              "downstreamPipeline": {
                "id": "gid://gitlab/Ci::Pipeline/213",
                "path": "/root/downstream-pipeline-project/-/pipelines/213"
              }
            },
            {
              "downstreamPipeline": null <- this is a build
            }
          ]
        }
      }
    }
  }
}

How to set up and validate locally

In a project with a downstream pipeline, use the GraphQL query posted above. Most simple config to set this up (within the same project):

.gitlab-ci.yml

child-pipeline.yml

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Laura Montemayor

Merge request reports

Loading