Skip to content

Makes pipeline be searchable by sha or iid

Laura Montemayor requested to merge lm-add-short-sha-and-path-to-pipeline into master

What does this MR do?

Updates the ProjectPipelineResolver to be able to find a pipeline by either iid or sha. This is intended to help the frontend efforts here: #280829 (closed)

BE issue: #321038 (closed)

This also adds the commitPath field to PipelineType

Example queries

by iid:

query {
  project(fullPath: "gitlab-org/gitlab-test"){
    pipeline(iid: 1) {
      commitPath
      }
    }
  }
}

by sha:

query {
  project(fullPath: "gitlab-org/gitlab-test"){
    pipeline(sha:"ddd0f15ae83993f5cb66a927a28673882e99100b"){
      commitPath
    }
  }
}

Response for both:

{
  "data": {
    "project": {
      "pipeline": {
        "commitPath": "/gitlab-org/gitlab-test/-/commit/ddd0f15ae83993f5cb66a927a28673882e99100b"
      }
    }
  }
}

Does this MR meet the acceptance criteria?

Conformity

Edited by Laura Montemayor

Merge request reports