Commit 17a9b4c
feat: cascade delete all children on pipeline delete
What:
- Replace placeholder with DeleteAllTriggerRuns + DeleteAllPipelineRuns calls
(fatal errors cause requeue, best-effort revision cleanup follows).
- Wire revision.Manager into the Pipeline Reconciler (defaults to NoOpManager)
and invoke DeleteAllRevisions after children are deleted, mirroring the
deployment controller's pattern.
- Remove finalizer only after all children successfully deleted.
- Add TestCascadeDelete_AllTerminal, TestCascadeDelete_RevisionsCleaned, and
TestCascadeDelete_SkippedPRsTerminal tests.
Why:
- Users running `ma pipeline delete` previously had to manually kill active
TriggerRuns/PipelineRuns, wait for terminal states, and delete each child
CR one by one. Now the controller does this transparently when a Pipeline
CR is marked for deletion.
How to test:
- bazel test //go/components/pipeline/... (all new regression tests pass).
- Manually: `ma pipeline delete` against a pipeline with terminal children and
observe that child CRs are removed before the pipeline CR disappears.
Breaking changes:
- `ma pipeline delete <pipeline>` now cascades to all child TriggerRuns,
PipelineRuns, and Revisions belonging to the pipeline. Every child CR is
deleted along with the pipeline. There is no undo.
- Deletion is asynchronous (finalizer removal happens after cascade completes).
If you relied on `ma pipeline delete` returning once the Pipeline CR is
actually gone from etcd, you now need to poll `ma pipeline get` or similar
until NotFound.
- Any external tooling that previously issued its own cleanup for TRs/PRs/
Revisions should be simplified: those children are now cleaned up by the
controller. Double-delete is safe (NotFound is tolerated) but unnecessary.
Co-Authored-By: Oz <oz-agent@warp.dev>1 parent 424965e commit 17a9b4c
3 files changed
Lines changed: 343 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
227 | | - | |
228 | | - | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
232 | 277 | | |
233 | 278 | | |
234 | 279 | | |
| |||
270 | 315 | | |
271 | 316 | | |
272 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
273 | 321 | | |
274 | 322 | | |
275 | 323 | | |
| |||
0 commit comments