Add pipeline statuses subscription
What does this MR do and why?
Adds ci_pipeline_statuses_updated subscription to provide real-time updates to the UI. A user subscribes to a project and when a pipeline updates that pipeline is sent to the client. Follows a very similar pattern that I did for pipeline schedules as seen here: !200990 (merged)
This is a key feature needed to support real-time statuses on Build > Pipelines and an MR pipelines tab.
References
Screenshots or screen recordings
How to set up and validate locally
- Enable FF
ci_pipeline_statuses_updated_subscription - Create a pipeline (or multiple to help with testing)
- Visit http://gdk.test:3000/-/graphql-explorer and use the subscription with your project ID (where the pipelines are)
subscription {
ciPipelineStatusesUpdated(projectId: "gid://gitlab/Project/19") {
id
status
}
}
- Trigger a change on the pipeline and watch data update in the explorer and network tab (sockets)
OR trigger pipeline changes in rails console based on and ID
pipeline = Ci::Pipeline.find(YOUR_ID)
# Test multiple status changes
pipeline.run!
# Check subscription fired with "running"
pipeline.succeed!
# Check subscription fired with "success"
pipeline.run!
# Check subscription fired again with "running"
pipeline.drop!
# Check subscription fired with "failed"
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Payton Burdette
