From 825855f44212551bf0592afbbf3e6808ae2460a8 Mon Sep 17 00:00:00 2001 From: a1k0u Date: Fri, 6 Sep 2024 09:56:13 +0300 Subject: [PATCH] fix(delete): [JENKINS-70252] delete WorkflowRun before WorkflowJob folder --- .../java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java index bc05f413..582e499d 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java @@ -663,6 +663,11 @@ public void replaceAction(@NonNull Action a) { @Override protected void performDelete() throws IOException, InterruptedException { setDisabled(true); Jenkins.get().getQueue().cancel(this); + + for (WorkflowRun workflowRun : getBuilds()) { + workflowRun.delete(); + } + // TODO call SCM.processWorkspaceBeforeDeletion super.performDelete(); }