Skip to content

Add pipeline to CI job GraphQL type

Tiger Watson requested to merge 267168-add-pipeline-to-ci-job-type into master

What does this MR do?

Allows fetching pipeline details from a CI job in GraphQL.

This will allow types that link to a job to also retrieve details about the pipeline (eg. !47339 (merged)).

GraphQL example

Request

{
  project(fullPath: "example/path") {
    id
    
    pipeline(iid: 1) {
      id
      
      jobs {
        nodes {
          name

          pipeline {
            id
          }
        }
      }
    }
  }
}

Response

{
  "data": {
    "project": {
      "id": "gid://gitlab/Project/20",
      "pipeline": {
        "id": "gid://gitlab/Ci::Pipeline/82",
        "jobs": {
          "nodes": [
            {
              "name": "test",
              "pipeline": {
                "id": "gid://gitlab/Ci::Pipeline/82"
              }
            },
          ]
        }
      }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #267168

Edited by Tiger Watson

Merge request reports