graphql: Add merge_request_event_type field to pipeline_type
What does this MR do and why?
This MR adds pipeline.merge_request_event_type
to the pipeline_type
GraphQL type.
This information is already exposed via the PipelineEntity
serializer (eg. /pipelines.json endpoint on a merge request). This brings the same functionality to GraphQL.
This will assist with #336799 (closed).
Screenshots or screen recordings
How to set up and validate locally
- Enable gitlab-runner on a project
- Create a .gitlab-ci.yml file with
only: - merge_requests
- Create a merge request
- Wait for the pipeline to finish
- In http://localhost:3000/-/graphql-explorer run:
query {
project(fullPath:"h5bp/html5-boilerplate") {
mergeRequest(iid:"7"){
headPipeline {
mergeRequestEventType
}
}
pipelines {
nodes {
mergeRequestEventType
}
}
}
}
replacing fullPath
and iid
with your own project path and MR details
- See that the merge request event type is present
- Run a pipeline against the main branch and repeat the last two steps, see that the merge request event type is null
- Enable merge trains on your project
- Start a merge train
- Repeat graphql step 5 and see the
MERGE_TRAIN
in the merge request event type
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #336799 (closed)