Return latest pipeline from project pipelines GraphQL query
What does this MR do and why?
Related to #482803 (closed)
In &13066 (closed) we are moving Your work -> Projects to Vue and using GraphQL as the data source. We need to be able to get the pipeline status for projects from the GraphQL query but this is not possible at the moment. This MR updates Resolvers::Ci::ProjectPipelineResolver to return the latest pipeline for the project if no arguments are passed.
Originally I had taken a different approach in !164943 (closed) but after much discussion we decided to take this approach instead.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Discussion about previous implementation - !164943 (comment 2209314586)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Star some projects that have pipelines
- Go to http://gdk.test:3000/-/graphql-explorer
- Run this query
query getProjects {
currentUser {
starredProjects(sort: CREATED_ASC) {
nodes {
pipeline {
detailedStatus {
label
name
}
}
}
}
}
}