Forbid directly deleting non-orphaned child pipelines
Problem
@fabiopitino
said:
Like we don't allow jobs to be deleted in isolation we should not allow a child pipeline to be deleted while the parent pipeline remains.
- We should not allow children with parents to be deleted.
- Before #39503 is implemented GitLab will leave orphaned children when deleting the parents. Users should be allowed to directly delete these so that they can free space by cleaning up pipelines.
Proposal
Backend
- Before triggering the pipeline
Ci::DestroyPipelineService
from any API endpoint we check for either:
- The pipeline is a parent pipeline
- the pipeline is an orphaned child (has no parent)
- Pass to the frontend an attribute that tells if the pipeline is deletable based on the same checks we applied to the api
Frontend
- In the UI we need to disable the Delete pipeline button(Add pipeline deletion button to UI (!21365 - merged) with a tooltip if the pipeline cannot be deleted.
Edited by Allison Browne