diff --git a/core/src/main/java/io/kestra/core/models/executions/Execution.java b/core/src/main/java/io/kestra/core/models/executions/Execution.java index 66e44e50ccb..1e30b1e4d1d 100644 --- a/core/src/main/java/io/kestra/core/models/executions/Execution.java +++ b/core/src/main/java/io/kestra/core/models/executions/Execution.java @@ -353,27 +353,27 @@ public List findTaskDependingFlowState( * * @param resolvedTasks normal tasks * @param resolvedErrors errors tasks - * @param resolvedAlways afters tasks + * @param resolvedFinally afters tasks * @param parentTaskRun the parent task * @return the flow we need to follow */ public List findTaskDependingFlowState( List resolvedTasks, @Nullable List resolvedErrors, - @Nullable List resolvedAlways, + @Nullable List resolvedFinally, TaskRun parentTaskRun ) { resolvedTasks = removeDisabled(resolvedTasks); resolvedErrors = removeDisabled(resolvedErrors); - resolvedAlways = removeDisabled(resolvedAlways); + resolvedFinally = removeDisabled(resolvedFinally); List errorsFlow = this.findTaskRunByTasks(resolvedErrors, parentTaskRun); - List alwaysFlow = this.findTaskRunByTasks(resolvedAlways, parentTaskRun); + List finallyFlow = this.findTaskRunByTasks(resolvedFinally, parentTaskRun); - // always is already started, just continue theses always - if (!alwaysFlow.isEmpty()) { - return resolvedAlways == null ? Collections.emptyList() : resolvedAlways; + // finally is already started, just continue theses finally + if (!finallyFlow.isEmpty()) { + return resolvedFinally == null ? Collections.emptyList() : resolvedFinally; } // Check if flow has failed task @@ -383,15 +383,15 @@ public List findTaskDependingFlowState( return Collections.emptyList(); } - if (resolvedAlways != null && resolvedErrors != null && !this.isTerminated(resolvedErrors, parentTaskRun)) { + if (resolvedFinally != null && resolvedErrors != null && !this.isTerminated(resolvedErrors, parentTaskRun)) { return resolvedErrors; - } else if (resolvedAlways == null) { + } else if (resolvedFinally == null) { return resolvedErrors == null ? Collections.emptyList() : resolvedErrors; } } - if (this.isTerminated(resolvedTasks, parentTaskRun) && resolvedAlways != null) { - return resolvedAlways; + if (this.isTerminated(resolvedTasks, parentTaskRun) && resolvedFinally != null) { + return resolvedFinally; } return resolvedTasks; diff --git a/core/src/main/java/io/kestra/core/models/flows/Flow.java b/core/src/main/java/io/kestra/core/models/flows/Flow.java index a5113ae53c1..f16739a63e4 100644 --- a/core/src/main/java/io/kestra/core/models/flows/Flow.java +++ b/core/src/main/java/io/kestra/core/models/flows/Flow.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -32,10 +33,7 @@ import jakarta.validation.ConstraintViolationException; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; +import lombok.*; import lombok.experimental.SuperBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -82,7 +80,13 @@ public boolean hasIgnoreMarker(final AnnotatedMember m) { List errors; @Valid - List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Valid @Deprecated @@ -191,7 +195,7 @@ public Stream allTasks() { return Stream.of( this.tasks != null ? this.tasks : new ArrayList(), this.errors != null ? this.errors : new ArrayList(), - this.always != null ? this.always : new ArrayList(), + this._finally != null ? this._finally : new ArrayList(), this.listenersTasks() ) .flatMap(Collection::stream); diff --git a/core/src/main/java/io/kestra/core/models/flows/FlowForExecution.java b/core/src/main/java/io/kestra/core/models/flows/FlowForExecution.java index 93298148bf7..b144c56537a 100644 --- a/core/src/main/java/io/kestra/core/models/flows/FlowForExecution.java +++ b/core/src/main/java/io/kestra/core/models/flows/FlowForExecution.java @@ -25,7 +25,7 @@ public class FlowForExecution extends AbstractFlow { List errors; @Valid - List always; + List _finally; @Valid List triggers; @@ -39,7 +39,7 @@ public static FlowForExecution of(Flow flow) { .inputs(flow.getInputs()) .tasks(flow.getTasks().stream().map(TaskForExecution::of).toList()) .errors(ListUtils.emptyOnNull(flow.getErrors()).stream().map(TaskForExecution::of).toList()) - .always(ListUtils.emptyOnNull(flow.getAlways()).stream().map(TaskForExecution::of).toList()) + ._finally(ListUtils.emptyOnNull(flow.getFinally()).stream().map(TaskForExecution::of).toList()) .triggers(ListUtils.emptyOnNull(flow.getTriggers()).stream().map(AbstractTriggerForExecution::of).toList()) .disabled(flow.isDisabled()) .deleted(flow.isDeleted()) diff --git a/core/src/main/java/io/kestra/core/models/flows/FlowWithSource.java b/core/src/main/java/io/kestra/core/models/flows/FlowWithSource.java index 9eae0c80724..ed64f1a9524 100644 --- a/core/src/main/java/io/kestra/core/models/flows/FlowWithSource.java +++ b/core/src/main/java/io/kestra/core/models/flows/FlowWithSource.java @@ -28,7 +28,7 @@ public Flow toFlow() { .variables(this.variables) .tasks(this.tasks) .errors(this.errors) - .always(this.always) + ._finally(this._finally) .listeners(this.listeners) .triggers(this.triggers) .pluginDefaults(this.pluginDefaults) @@ -70,7 +70,7 @@ public static FlowWithSource of(Flow flow, String source) { .variables(flow.variables) .tasks(flow.tasks) .errors(flow.errors) - .always(flow.always) + ._finally(flow._finally) .listeners(flow.listeners) .triggers(flow.triggers) .pluginDefaults(flow.pluginDefaults) diff --git a/core/src/main/java/io/kestra/core/models/hierarchies/GraphCluster.java b/core/src/main/java/io/kestra/core/models/hierarchies/GraphCluster.java index 2ca02c85282..6c5f367e527 100644 --- a/core/src/main/java/io/kestra/core/models/hierarchies/GraphCluster.java +++ b/core/src/main/java/io/kestra/core/models/hierarchies/GraphCluster.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import io.kestra.core.models.executions.TaskRun; import io.kestra.core.models.tasks.Task; -import lombok.Builder; +import lombok.AccessLevel; import lombok.Getter; import lombok.Setter; @@ -26,7 +26,12 @@ public class GraphCluster extends AbstractGraph { private final GraphClusterRoot root; @JsonIgnore - private final GraphClusterAlways always; + @Getter(AccessLevel.NONE) + private final GraphClusterFinally _finally; + + public GraphClusterFinally getFinally() { + return _finally; + } @JsonIgnore private final GraphClusterEnd end; @@ -44,15 +49,15 @@ public GraphCluster(String uid) { this.relationType = null; this.root = new GraphClusterRoot(); - this.always = new GraphClusterAlways(); + this._finally = new GraphClusterFinally(); this.end = new GraphClusterEnd(); this.taskNode = null; this.addNode(this.root); - this.addNode(this.always); + this.addNode(this._finally); this.addNode(this.end); - this.addEdge(this.getAlways(), this.getEnd(), new Relation()); + this.addEdge(this.getFinally(), this.getEnd(), new Relation()); } public GraphCluster(Task task, TaskRun taskRun, List values, RelationType relationType) { @@ -68,15 +73,15 @@ protected GraphCluster(AbstractGraphTask taskNode, String uid, RelationType rela this.relationType = relationType; this.root = new GraphClusterRoot(); - this.always = new GraphClusterAlways(); + this._finally = new GraphClusterFinally(); this.end = new GraphClusterEnd(); this.taskNode = taskNode; this.addNode(this.root); - this.addNode(this.always); + this.addNode(this._finally); this.addNode(this.end); - this.addEdge(this.getAlways(), this.getEnd(), new Relation()); + this.addEdge(this.getFinally(), this.getEnd(), new Relation()); } public void addNode(AbstractGraph node) { diff --git a/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterAlways.java b/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterAlways.java deleted file mode 100644 index a5cfaf21a27..00000000000 --- a/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterAlways.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.kestra.core.models.hierarchies; - -import io.kestra.core.utils.IdUtils; -import lombok.Getter; - -@Getter -public class GraphClusterAlways extends AbstractGraph { - public GraphClusterAlways() { - super("always-" + IdUtils.create()); - } -} diff --git a/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterFinally.java b/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterFinally.java new file mode 100644 index 00000000000..a718d15241c --- /dev/null +++ b/core/src/main/java/io/kestra/core/models/hierarchies/GraphClusterFinally.java @@ -0,0 +1,11 @@ +package io.kestra.core.models.hierarchies; + +import io.kestra.core.utils.IdUtils; +import lombok.Getter; + +@Getter +public class GraphClusterFinally extends AbstractGraph { + public GraphClusterFinally() { + super("finally-" + IdUtils.create()); + } +} diff --git a/core/src/main/java/io/kestra/core/models/hierarchies/RelationType.java b/core/src/main/java/io/kestra/core/models/hierarchies/RelationType.java index b6bb701dc35..086ead91552 100644 --- a/core/src/main/java/io/kestra/core/models/hierarchies/RelationType.java +++ b/core/src/main/java/io/kestra/core/models/hierarchies/RelationType.java @@ -4,7 +4,7 @@ public enum RelationType { SEQUENTIAL, CHOICE, ERROR, - ALWAYS, + FINALLY, PARALLEL, DYNAMIC } diff --git a/core/src/main/java/io/kestra/core/models/tasks/FlowableTask.java b/core/src/main/java/io/kestra/core/models/tasks/FlowableTask.java index 6c08baf9a61..4231d0e1689 100644 --- a/core/src/main/java/io/kestra/core/models/tasks/FlowableTask.java +++ b/core/src/main/java/io/kestra/core/models/tasks/FlowableTask.java @@ -28,7 +28,7 @@ public interface FlowableTask { title = "List of tasks to run after any tasks failed or success on this FlowableTask." ) @PluginProperty - List getAlways(); + List getFinally(); /** * Create the topology representation of a flowable task. @@ -77,7 +77,7 @@ default Optional resolveState(RunContext runContext, Execution execu execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, isAllowFailure(), diff --git a/core/src/main/java/io/kestra/core/models/templates/Template.java b/core/src/main/java/io/kestra/core/models/templates/Template.java index 4ea9f28f0fd..dade9aa39dc 100644 --- a/core/src/main/java/io/kestra/core/models/templates/Template.java +++ b/core/src/main/java/io/kestra/core/models/templates/Template.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; @@ -68,7 +69,13 @@ public boolean hasIgnoreMarker(final AnnotatedMember m) { private List errors; @Valid - private List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @NotNull @Builder.Default @@ -141,7 +148,7 @@ public Template toDeleted() { this.description, this.tasks, this.errors, - this.always, + this._finally, true ); } diff --git a/core/src/main/java/io/kestra/core/runners/ExecutorService.java b/core/src/main/java/io/kestra/core/runners/ExecutorService.java index f48b79c239e..9c5da521b2a 100644 --- a/core/src/main/java/io/kestra/core/runners/ExecutorService.java +++ b/core/src/main/java/io/kestra/core/runners/ExecutorService.java @@ -271,7 +271,7 @@ private Optional childWorkerTaskResult(Flow flow, Execution ex List currentTasks = execution.findTaskDependingFlowState( flowableParent.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(flowableParent.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(flowableParent.getAlways(), parentTaskRun) + FlowableUtils.resolveTasks(flowableParent.getFinally(), parentTaskRun) ); List taskRunByTasks = execution.findTaskRunByTasks(currentTasks, parentTaskRun); @@ -428,7 +428,7 @@ private Executor handleNext(Executor executor) { executor.getExecution(), ResolvedTask.of(executor.getFlow().getTasks()), ResolvedTask.of(executor.getFlow().getErrors()), - ResolvedTask.of(executor.getFlow().getAlways()) + ResolvedTask.of(executor.getFlow().getFinally()) ); if (nextTaskRuns.isEmpty()) { @@ -689,7 +689,7 @@ private Executor handleEnd(Executor executor) { List currentTasks = executor.getExecution().findTaskDependingFlowState( ResolvedTask.of(executor.getFlow().getTasks()), ResolvedTask.of(executor.getFlow().getErrors()), - ResolvedTask.of(executor.getFlow().getAlways()) + ResolvedTask.of(executor.getFlow().getFinally()) ); if (!executor.getExecution().isTerminated(currentTasks)) { diff --git a/core/src/main/java/io/kestra/core/runners/FlowableUtils.java b/core/src/main/java/io/kestra/core/runners/FlowableUtils.java index 3d5ffbc1b38..782ba4b66c9 100644 --- a/core/src/main/java/io/kestra/core/runners/FlowableUtils.java +++ b/core/src/main/java/io/kestra/core/runners/FlowableUtils.java @@ -33,19 +33,19 @@ public static List resolveSequentialNexts( Execution execution, List tasks, List errors, - List always + List _finally ) { - return resolveSequentialNexts(execution, tasks, errors, always, null); + return resolveSequentialNexts(execution, tasks, errors, _finally, null); } public static List resolveSequentialNexts( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun ) { - List currentTasks = execution.findTaskDependingFlowState(tasks, errors, always, parentTaskRun); + List currentTasks = execution.findTaskDependingFlowState(tasks, errors, _finally, parentTaskRun); return FlowableUtils.innerResolveSequentialNexts(execution, currentTasks, parentTaskRun); } @@ -95,10 +95,10 @@ public static List resolveWaitForNext( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun ) { - List currentTasks = execution.findTaskDependingFlowState(tasks, errors, always, parentTaskRun); + List currentTasks = execution.findTaskDependingFlowState(tasks, errors, _finally, parentTaskRun); // nothing if (currentTasks == null || currentTasks.isEmpty() || execution.getState().getCurrent() == State.Type.KILLING) { @@ -144,13 +144,13 @@ public static Optional resolveState( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun, RunContext runContext, boolean allowFailure, boolean allowWarning ) { - List currentTasks = execution.findTaskDependingFlowState(tasks, errors, always, parentTaskRun); + List currentTasks = execution.findTaskDependingFlowState(tasks, errors, _finally, parentTaskRun); if (currentTasks == null) { runContext.logger().warn( @@ -202,7 +202,7 @@ public static List resolveParallelNexts( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun, Integer concurrency ) { @@ -210,7 +210,7 @@ public static List resolveParallelNexts( execution, tasks, errors, - always, + _finally, parentTaskRun, concurrency, (nextTaskRunStream, taskRuns) -> nextTaskRunStream @@ -225,7 +225,7 @@ public static List resolveConcurrentNexts( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun, Integer concurrency ) { @@ -236,7 +236,7 @@ public static List resolveConcurrentNexts( List allTasks = execution.findTaskDependingFlowState( tasks, errors, - always, + _finally, parentTaskRun ); @@ -292,7 +292,7 @@ public static List resolveDagNexts( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun, Integer concurrency, List taskDependencies @@ -301,7 +301,7 @@ public static List resolveDagNexts( execution, tasks, errors, - always, + _finally, parentTaskRun, concurrency, (nextTaskRunStream, taskRuns) -> nextTaskRunStream @@ -334,7 +334,7 @@ public static List resolveParallelNexts( Execution execution, List tasks, List errors, - List always, + List _finally, TaskRun parentTaskRun, Integer concurrency, BiFunction, List, Stream> nextTaskRunFunction @@ -346,7 +346,7 @@ public static List resolveParallelNexts( List currentTasks = execution.findTaskDependingFlowState( tasks, errors, - always, + _finally, parentTaskRun ); diff --git a/core/src/main/java/io/kestra/core/services/Graph2DotService.java b/core/src/main/java/io/kestra/core/services/Graph2DotService.java index fccbf66a254..8c2fbbe35e5 100644 --- a/core/src/main/java/io/kestra/core/services/Graph2DotService.java +++ b/core/src/main/java/io/kestra/core/services/Graph2DotService.java @@ -66,7 +66,7 @@ private static String node(AbstractGraph node) { private static String label(AbstractGraph node) { String shape; - if (node instanceof GraphClusterRoot || node instanceof GraphClusterAlways || node instanceof GraphClusterEnd) { + if (node instanceof GraphClusterRoot || node instanceof GraphClusterFinally || node instanceof GraphClusterEnd) { shape = "point"; } else { shape = "box"; diff --git a/core/src/main/java/io/kestra/core/utils/GraphUtils.java b/core/src/main/java/io/kestra/core/utils/GraphUtils.java index 5936217c8cf..c06a2284c9c 100644 --- a/core/src/main/java/io/kestra/core/utils/GraphUtils.java +++ b/core/src/main/java/io/kestra/core/utils/GraphUtils.java @@ -42,7 +42,7 @@ public static GraphCluster of(GraphCluster graph, Flow flow, Execution execution graph, flow.getTasks(), flow.getErrors(), - flow.getAlways(), + flow.getFinally(), null, execution ); @@ -79,7 +79,7 @@ public static GraphCluster triggers(GraphCluster graph, List tr triggerCluster.addEdge(triggerNode, triggerCluster.getEnd(), new Relation()); }); - removeAlways(triggerCluster); + removeFinally(triggerCluster); return triggerCluster; } @@ -168,29 +168,29 @@ public static void sequential( GraphCluster graph, List tasks, List errors, - List always, + List _finally, TaskRun parent, Execution execution ) throws IllegalVariableEvaluationException { - iterate(graph, tasks, errors, always, parent, execution, RelationType.SEQUENTIAL); + iterate(graph, tasks, errors, _finally, parent, execution, RelationType.SEQUENTIAL); } public static void parallel( GraphCluster graph, List tasks, List errors, - List always, + List _finally, TaskRun parent, Execution execution ) throws IllegalVariableEvaluationException { - iterate(graph, tasks, errors, always, parent, execution, RelationType.PARALLEL); + iterate(graph, tasks, errors, _finally, parent, execution, RelationType.PARALLEL); } public static void switchCase( GraphCluster graph, Map> tasks, List errors, - List always, + List _finally, TaskRun parent, Execution execution ) throws IllegalVariableEvaluationException { @@ -198,14 +198,14 @@ public static void switchCase( fillGraph(graph, entry.getValue(), RelationType.SEQUENTIAL, parent, execution, entry.getKey()); } - fillAlternativePaths(graph, errors, always, parent, execution, null); + fillAlternativePaths(graph, errors, _finally, parent, execution, null); } public static void ifElse( GraphCluster graph, List then, List _else, - List always, + List _finally, List errors, TaskRun parent, Execution execution @@ -215,40 +215,40 @@ public static void ifElse( fillGraph(graph, _else, RelationType.SEQUENTIAL, parent, execution, "else"); } - fillAlternativePaths(graph, errors, always, parent, execution, null); + fillAlternativePaths(graph, errors, _finally, parent, execution, null); } public static void dag( GraphCluster graph, List tasks, List errors, - List always, + List _finally, TaskRun parent, Execution execution ) throws IllegalVariableEvaluationException { fillGraphDag(graph, tasks, parent, execution); - fillAlternativePaths(graph, errors, always, parent, execution, null); + fillAlternativePaths(graph, errors, _finally, parent, execution, null); } private static void iterate( GraphCluster graph, List tasks, List errors, - List always, + List _finally, TaskRun parent, Execution execution, RelationType relationType ) throws IllegalVariableEvaluationException { fillGraph(graph, tasks, relationType, parent, execution, null); - fillAlternativePaths(graph, errors, always, parent, execution, null); + fillAlternativePaths(graph, errors, _finally, parent, execution, null); } private static void fillAlternativePaths( GraphCluster graph, List errors, - List always, + List _finally, TaskRun parent, Execution execution, String value @@ -258,29 +258,29 @@ private static void fillAlternativePaths( fillGraph(graph, errors, RelationType.ERROR, parent, execution, value); } - // always cases - if (always != null && !always.isEmpty()) { - fillGraph(graph, always, RelationType.ALWAYS, parent, execution, value); + // finally cases + if (_finally != null && !_finally.isEmpty()) { + fillGraph(graph, _finally, RelationType.FINALLY, parent, execution, value); } else { - removeAlways(graph); + removeFinally(graph); } } - private static void removeAlways(GraphCluster graph) { - // we don't have always case, so we remove the node, and link all previous link to always to the end + private static void removeFinally(GraphCluster graph) { + // we don't have finally case, so we remove the node, and link all previous link to finally to the end graph.getGraph().edges() .forEach(edge -> { - if (edge.getSource() instanceof GraphClusterAlways && edge.getTarget() instanceof GraphClusterEnd) { + if (edge.getSource() instanceof GraphClusterFinally && edge.getTarget() instanceof GraphClusterEnd) { graph.getGraph().edges().remove(edge); } - if (edge.getTarget() instanceof GraphClusterAlways) { + if (edge.getTarget() instanceof GraphClusterFinally) { graph.getGraph().edges().remove(edge); graph.addEdge(edge.getSource(), graph.getEnd(), edge.getValue()); } }); - graph.getGraph().removeNode(graph.getAlways()); + graph.getGraph().removeNode(graph.getFinally()); } private static void fillGraph( @@ -295,10 +295,10 @@ private static void fillGraph( AbstractGraph previous; previous = Optional.ofNullable(graph.getTaskNode()).orElse(graph.getRoot()); - if (relationType == RelationType.ALWAYS) { - previous = graph.getAlways(); + if (relationType == RelationType.FINALLY) { + previous = graph.getFinally(); - graph.getGraph().removeEdge(graph.getAlways(), graph.getEnd()); + graph.getGraph().removeEdge(graph.getFinally(), graph.getEnd()); } boolean isFirst = true; @@ -362,13 +362,13 @@ private static void fillGraph( if (currentGraph instanceof GraphCluster && ((GraphCluster) currentGraph).getEnd() != null) { graph.addEdge( ((GraphCluster) currentGraph).getEnd(), - relationType == RelationType.ALWAYS ? graph.getEnd() : graph.getAlways(), + relationType == RelationType.FINALLY ? graph.getEnd() : graph.getFinally(), new Relation() ); } else { graph.addEdge( currentGraph, - relationType == RelationType.ALWAYS ? graph.getEnd() : graph.getAlways(), + relationType == RelationType.FINALLY ? graph.getEnd() : graph.getFinally(), new Relation() ); } @@ -379,7 +379,7 @@ private static void fillGraph( if (!iterator.hasNext() && !isAllLinkToEnd(relationType)) { graph.addEdge( currentGraph instanceof GraphCluster ? ((GraphCluster) currentGraph).getEnd() : currentGraph, - relationType == RelationType.ALWAYS ? graph.getEnd() : graph.getAlways(), + relationType == RelationType.FINALLY ? graph.getEnd() : graph.getFinally(), new Relation() ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/AllowFailure.java b/core/src/main/java/io/kestra/plugin/core/flow/AllowFailure.java index a30ecdb9b2c..db465486a9b 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/AllowFailure.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/AllowFailure.java @@ -59,13 +59,13 @@ public class AllowFailure extends Sequential implements FlowableTask public Optional resolveState(RunContext runContext, Execution execution, TaskRun parentTaskRun) throws IllegalVariableEvaluationException { List resolvedTasks = this.childTasks(runContext, parentTaskRun); List resolvedErrors = FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun); - List resolvedAlways = FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun); + List resolvedFinally = FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun); Optional type = FlowableUtils.resolveState( execution, resolvedTasks, resolvedErrors, - resolvedAlways, + resolvedFinally, parentTaskRun, runContext, this.isAllowFailure(), @@ -79,7 +79,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, resolvedTasks, null, - resolvedAlways, + resolvedFinally, parentTaskRun, runContext, this.isAllowFailure(), diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Dag.java b/core/src/main/java/io/kestra/plugin/core/flow/Dag.java index 25e94e5b1e2..2b48d08a41a 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Dag.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Dag.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; @@ -23,7 +24,6 @@ import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; import java.util.*; -import java.util.stream.Collectors; import java.util.stream.Stream; @@ -105,7 +105,13 @@ public class Dag extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Override public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List parentValues) throws IllegalVariableEvaluationException { @@ -117,7 +123,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.errors, - this.always, + this._finally, taskRun, execution ); @@ -144,7 +150,7 @@ public List allChildTasks() { this.tasks != null ? this.tasks.stream().map(DagTask::getTask) : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) .toList(); @@ -163,7 +169,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun, this.concurrent, this.tasks diff --git a/core/src/main/java/io/kestra/plugin/core/flow/EachParallel.java b/core/src/main/java/io/kestra/plugin/core/flow/EachParallel.java index a821c8de651..3f315ee87be 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/EachParallel.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/EachParallel.java @@ -147,7 +147,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.errors, - this.always, + this._finally, taskRun, execution ); @@ -172,7 +172,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, childTasks, FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, this.isAllowFailure(), @@ -186,7 +186,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, FlowableUtils.resolveEachTasks(runContext, parentTaskRun, this.getTasks(), this.value), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun, this.concurrent ); diff --git a/core/src/main/java/io/kestra/plugin/core/flow/EachSequential.java b/core/src/main/java/io/kestra/plugin/core/flow/EachSequential.java index cd2c00f4564..9e2ab4693ce 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/EachSequential.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/EachSequential.java @@ -111,7 +111,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.errors, - this.always, + this._finally, taskRun, execution ); @@ -136,7 +136,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, childTasks, FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, this.isAllowFailure(), @@ -150,7 +150,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, FlowableUtils.resolveEachTasks(runContext, parentTaskRun, this.getTasks(), this.value), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/ForEach.java b/core/src/main/java/io/kestra/plugin/core/flow/ForEach.java index f47ee6f22ee..2d9d80319d5 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/ForEach.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/ForEach.java @@ -173,7 +173,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.getErrors(), - this.getAlways(), + this.getFinally(), taskRun, execution ); @@ -182,7 +182,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.getErrors(), - this.getAlways(), + this.getFinally(), taskRun, execution ); @@ -208,7 +208,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, childTasks, FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, this.isAllowFailure(), @@ -223,7 +223,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } @@ -232,7 +232,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, FlowableUtils.resolveEachTasks(runContext, parentTaskRun, this.getTasks(), this.values), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun, this.concurrencyLimit ); diff --git a/core/src/main/java/io/kestra/plugin/core/flow/ForEachItem.java b/core/src/main/java/io/kestra/plugin/core/flow/ForEachItem.java index 3e21c5b555c..dc680ac5905 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/ForEachItem.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/ForEachItem.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import io.kestra.core.exceptions.IllegalVariableEvaluationException; @@ -33,11 +34,7 @@ import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotNull; -import lombok.Builder; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; +import lombok.*; import lombok.experimental.SuperBuilder; import java.io.*; @@ -318,7 +315,13 @@ public class ForEachItem extends Task implements FlowableTask, Child private List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Schema( title = "What to do when a failed execution is restarting.", @@ -339,7 +342,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.getTasks(), this.errors, - this.always, + this._finally, taskRun, execution ); @@ -354,7 +357,7 @@ public List allChildTasks() { this.getTasks() != null ? this.getTasks().stream() : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) .toList(); @@ -371,7 +374,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/If.java b/core/src/main/java/io/kestra/plugin/core/flow/If.java index 943f8b7146b..526681bdeac 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/If.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/If.java @@ -100,7 +100,13 @@ public class If extends Task implements FlowableTask { private List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Override public List getErrors() { @@ -115,7 +121,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.then, this._else, - this.always, + this._finally, this.errors, taskRun, execution @@ -133,7 +139,7 @@ public List allChildTasks() { this._else != null ? this._else.stream() : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) ) @@ -165,7 +171,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } @@ -182,7 +188,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, this.isAllowFailure(), diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Parallel.java b/core/src/main/java/io/kestra/plugin/core/flow/Parallel.java index 8042de88391..cd003fca447 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Parallel.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Parallel.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.models.annotations.PluginProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -21,7 +22,6 @@ import io.kestra.core.utils.GraphUtils; import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; @@ -84,7 +84,13 @@ public class Parallel extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Override public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List parentValues) throws IllegalVariableEvaluationException { @@ -94,7 +100,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.tasks, this.errors, - this.always, + this._finally, taskRun, execution ); @@ -109,7 +115,7 @@ public List allChildTasks() { this.tasks != null ? this.tasks.stream() : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) .toList(); @@ -126,7 +132,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun, this.concurrent ); diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Pause.java b/core/src/main/java/io/kestra/plugin/core/flow/Pause.java index 393d3b68d98..f83e4d1e97a 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Pause.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Pause.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; @@ -31,7 +32,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.stream.Collectors; import java.util.stream.Stream; @SuperBuilder @@ -157,7 +157,13 @@ public class Pause extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Valid @PluginProperty @@ -176,7 +182,7 @@ public AbstractGraph tasksTree(Execution execution, TaskRun taskRun, List allChildTasks() { this.getTasks() != null ? this.getTasks().stream() : Stream.empty(), Stream.concat( this.getErrors() != null ? this.getErrors().stream() : Stream.empty(), - this.getAlways() != null ? this.getAlways().stream() : Stream.empty() + this.getFinally() != null ? this.getFinally().stream() : Stream.empty() ) ) .toList(); @@ -212,7 +218,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Sequential.java b/core/src/main/java/io/kestra/plugin/core/flow/Sequential.java index 467bcdfd619..dc6c0907ed6 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Sequential.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Sequential.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; @@ -15,10 +16,7 @@ import io.kestra.core.runners.RunContext; import io.kestra.core.utils.GraphUtils; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; +import lombok.*; import lombok.experimental.SuperBuilder; import jakarta.validation.Valid; @@ -68,7 +66,13 @@ public class Sequential extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Valid @PluginProperty @@ -83,7 +87,7 @@ public AbstractGraph tasksTree(Execution execution, TaskRun taskRun, List allChildTasks() { this.getTasks() != null ? this.getTasks().stream() : Stream.empty(), Stream.concat( this.getErrors() != null ? this.getErrors().stream() : Stream.empty(), - this.getAlways() != null ? this.getAlways().stream() : Stream.empty() + this.getFinally() != null ? this.getFinally().stream() : Stream.empty() ) ) .toList(); @@ -114,7 +118,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Switch.java b/core/src/main/java/io/kestra/plugin/core/flow/Switch.java index 684fb9e554b..cdce4cd3c9f 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Switch.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Switch.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.common.collect.ImmutableMap; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; @@ -114,7 +115,13 @@ public class Switch extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } private String rendererValue(RunContext runContext) throws IllegalVariableEvaluationException { return runContext.render(this.value); @@ -129,7 +136,7 @@ public List allChildTasks() { this.cases != null ? this.cases.values().stream().flatMap(Collection::stream) : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) ) @@ -149,7 +156,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List ) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)), this.errors, - this.always, + this._finally, taskRun, execution ); @@ -175,7 +182,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, this.isAllowFailure(), @@ -189,7 +196,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/Template.java b/core/src/main/java/io/kestra/plugin/core/flow/Template.java index d07ec26c953..90974664c10 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/Template.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/Template.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.DeserializationException; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.exceptions.InternalException; @@ -93,7 +94,13 @@ public class Template extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @NotNull @Schema( @@ -140,7 +147,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, template.getTasks(), template.getErrors(), - template.getAlways(), + template.getFinally(), taskRun, execution ); @@ -179,7 +186,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(template.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(template.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(template.getFinally(), parentTaskRun), parentTaskRun ); } diff --git a/core/src/main/java/io/kestra/plugin/core/flow/WaitFor.java b/core/src/main/java/io/kestra/plugin/core/flow/WaitFor.java index b4ca283649b..505c37d991a 100644 --- a/core/src/main/java/io/kestra/plugin/core/flow/WaitFor.java +++ b/core/src/main/java/io/kestra/plugin/core/flow/WaitFor.java @@ -1,5 +1,6 @@ package io.kestra.plugin.core.flow; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.annotations.Example; import io.kestra.core.models.annotations.Plugin; @@ -74,7 +75,13 @@ public class WaitFor extends Task implements FlowableTask { protected List errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Valid @PluginProperty @@ -111,7 +118,7 @@ public AbstractGraph tasksTree(Execution execution, TaskRun taskRun, List allChildTasks() { tasks.stream(), Stream.concat( this.getErrors() != null ? this.getErrors().stream() : Stream.empty(), - this.getAlways() != null ? this.getAlways().stream() : Stream.empty() + this.getFinally() != null ? this.getFinally().stream() : Stream.empty() ) ) .toList(); @@ -144,7 +151,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun ); } @@ -201,7 +208,7 @@ public Optional resolveState(RunContext runContext, Execution execut execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.getErrors(), parentTaskRun), - FlowableUtils.resolveTasks(this.getAlways(), parentTaskRun), + FlowableUtils.resolveTasks(this.getFinally(), parentTaskRun), parentTaskRun, runContext, isAllowFailure(), diff --git a/core/src/test/java/io/kestra/core/models/flows/FlowWithSourceTest.java b/core/src/test/java/io/kestra/core/models/flows/FlowWithSourceTest.java index 31569b8e0f5..4cbcb0db6a5 100644 --- a/core/src/test/java/io/kestra/core/models/flows/FlowWithSourceTest.java +++ b/core/src/test/java/io/kestra/core/models/flows/FlowWithSourceTest.java @@ -101,11 +101,11 @@ void of() { .message("Error") .build() )) - .always(List.of( + ._finally(List.of( Log.builder() .id(IdUtils.create()) .type(Log.class.getName()) - .message("Always") + .message("Finally") .build() )) .listeners(List.of( diff --git a/core/src/test/java/io/kestra/core/models/hierarchies/FlowGraphTest.java b/core/src/test/java/io/kestra/core/models/hierarchies/FlowGraphTest.java index 661e11d8500..1711d6186a3 100644 --- a/core/src/test/java/io/kestra/core/models/hierarchies/FlowGraphTest.java +++ b/core/src/test/java/io/kestra/core/models/hierarchies/FlowGraphTest.java @@ -296,22 +296,22 @@ void dynamicIdSubflow() throws IllegalVariableEvaluationException, TimeoutExcept } @Test - void alwaysSequential() throws IllegalVariableEvaluationException, IOException { - FlowWithSource flow = this.parse("flows/valids/always-sequential.yaml"); + void finallySequential() throws IllegalVariableEvaluationException, IOException { + FlowWithSource flow = this.parse("flows/valids/finally-sequential.yaml"); FlowGraph flowGraph = GraphUtils.flowGraph(flow, null); assertThat(flowGraph.getNodes().size(), is(13)); assertThat(flowGraph.getEdges().size(), is(13)); assertThat(flowGraph.getClusters().size(), is(2)); - assertThat(edge(flowGraph, ".*seq.always.*", ".*seq.a1").getRelation().getRelationType(), is(RelationType.SEQUENTIAL)); - assertThat(edge(flowGraph, ".*seq.a1", ".*seq.a2").getRelation().getRelationType(), is(RelationType.ALWAYS)); + assertThat(edge(flowGraph, ".*seq.finally.*", ".*seq.a1").getRelation().getRelationType(), is(RelationType.SEQUENTIAL)); + assertThat(edge(flowGraph, ".*seq.a1", ".*seq.a2").getRelation().getRelationType(), is(RelationType.FINALLY)); assertThat(edge(flowGraph, ".*seq.a2", ".*seq.end.*").getRelation().getRelationType(), is(nullValue())); } @Test - void alwaysSequentialError() throws IllegalVariableEvaluationException, IOException { - FlowWithSource flow = this.parse("flows/valids/always-sequential-error.yaml"); + void finallySequentialError() throws IllegalVariableEvaluationException, IOException { + FlowWithSource flow = this.parse("flows/valids/finally-sequential-error.yaml"); FlowGraph flowGraph = GraphUtils.flowGraph(flow, null); assertThat(flowGraph.getNodes().size(), is(15)); @@ -319,15 +319,15 @@ void alwaysSequentialError() throws IllegalVariableEvaluationException, IOExcept assertThat(flowGraph.getClusters().size(), is(2)); assertThat(edge(flowGraph, ".*seq.e1", ".*seq.e2").getRelation().getRelationType(), is(RelationType.ERROR)); - assertThat(edge(flowGraph, ".*seq.e2", ".*seq.always.*").getRelation().getRelationType(), is(nullValue())); - assertThat(edge(flowGraph, ".*seq.always.*", ".*seq.a1").getRelation().getRelationType(), is(RelationType.SEQUENTIAL)); - assertThat(edge(flowGraph, ".*seq.a1", ".*seq.a2").getRelation().getRelationType(), is(RelationType.ALWAYS)); + assertThat(edge(flowGraph, ".*seq.e2", ".*seq.finally.*").getRelation().getRelationType(), is(nullValue())); + assertThat(edge(flowGraph, ".*seq.finally.*", ".*seq.a1").getRelation().getRelationType(), is(RelationType.SEQUENTIAL)); + assertThat(edge(flowGraph, ".*seq.a1", ".*seq.a2").getRelation().getRelationType(), is(RelationType.FINALLY)); assertThat(edge(flowGraph, ".*seq.a2", ".*seq.end.*").getRelation().getRelationType(), is(nullValue())); } @Test - void alwaysDag() throws IllegalVariableEvaluationException, IOException { - FlowWithSource flow = this.parse("flows/valids/always-dag.yaml"); + void finallyDag() throws IllegalVariableEvaluationException, IOException { + FlowWithSource flow = this.parse("flows/valids/finally-dag.yaml"); FlowGraph flowGraph = GraphUtils.flowGraph(flow, null); assertThat(flowGraph.getNodes().size(), is(17)); @@ -335,8 +335,8 @@ void alwaysDag() throws IllegalVariableEvaluationException, IOException { assertThat(flowGraph.getClusters().size(), is(2)); assertThat(edge(flowGraph, ".*dag.e1", ".*dag.e2").getRelation().getRelationType(), is(RelationType.ERROR)); - assertThat(edge(flowGraph, ".*dag.e2", ".*dag.always.*").getRelation().getRelationType(), is(nullValue())); - assertThat(edge(flowGraph, ".*dag.always.*", ".*dag.a1").getRelation().getRelationType(), is(RelationType.DYNAMIC)); + assertThat(edge(flowGraph, ".*dag.e2", ".*dag.finally.*").getRelation().getRelationType(), is(nullValue())); + assertThat(edge(flowGraph, ".*dag.finally.*", ".*dag.a1").getRelation().getRelationType(), is(RelationType.DYNAMIC)); assertThat(edge(flowGraph, ".*dag.a1", ".*dag.a2").getRelation().getRelationType(), is(RelationType.DYNAMIC)); assertThat(edge(flowGraph, ".*dag.a2", ".*dag.end.*").getRelation().getRelationType(), is(nullValue())); } diff --git a/core/src/test/java/io/kestra/core/runners/PluginDefaultsCaseTest.java b/core/src/test/java/io/kestra/core/runners/PluginDefaultsCaseTest.java index 5feb7c09b4f..59c7b7e2977 100644 --- a/core/src/test/java/io/kestra/core/runners/PluginDefaultsCaseTest.java +++ b/core/src/test/java/io/kestra/core/runners/PluginDefaultsCaseTest.java @@ -1,5 +1,6 @@ package io.kestra.core.runners; +import com.fasterxml.jackson.annotation.JsonProperty; import io.kestra.core.exceptions.IllegalVariableEvaluationException; import io.kestra.core.models.executions.Execution; import io.kestra.core.models.executions.NextTaskRun; @@ -15,16 +16,12 @@ import jakarta.inject.Singleton; import jakarta.validation.Valid; import jakarta.validation.constraints.NotEmpty; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; +import lombok.*; import lombok.experimental.SuperBuilder; import java.time.Duration; import java.util.List; import java.util.concurrent.TimeoutException; -import java.util.stream.Collectors; import java.util.stream.Stream; import static org.hamcrest.MatcherAssert.assertThat; @@ -66,7 +63,13 @@ public static class DefaultSequential1 extends Task implements FlowableTask errors; @Valid - protected List always; + @JsonProperty("finally") + @Getter(AccessLevel.NONE) + protected List _finally; + + public List getFinally() { + return this._finally; + } @Valid @NotEmpty @@ -82,7 +85,7 @@ public GraphCluster tasksTree(Execution execution, TaskRun taskRun, List subGraph, this.tasks, this.errors, - this.always, + this._finally, taskRun, execution ); @@ -97,7 +100,7 @@ public List allChildTasks() { this.tasks != null ? this.tasks.stream() : Stream.empty(), Stream.concat( this.errors != null ? this.errors.stream() : Stream.empty(), - this.always != null ? this.always.stream() : Stream.empty() + this._finally != null ? this._finally.stream() : Stream.empty() ) ) .toList(); @@ -114,7 +117,7 @@ public List resolveNexts(RunContext runContext, Execution execution execution, this.childTasks(runContext, parentTaskRun), FlowableUtils.resolveTasks(this.errors, parentTaskRun), - FlowableUtils.resolveTasks(this.always, parentTaskRun), + FlowableUtils.resolveTasks(this._finally, parentTaskRun), parentTaskRun ); } diff --git a/core/src/test/java/io/kestra/plugin/core/flow/AlwaysTest.java b/core/src/test/java/io/kestra/plugin/core/flow/FinallyTest.java similarity index 88% rename from core/src/test/java/io/kestra/plugin/core/flow/AlwaysTest.java rename to core/src/test/java/io/kestra/plugin/core/flow/FinallyTest.java index e2363cb2c78..2ca62a3d75a 100644 --- a/core/src/test/java/io/kestra/plugin/core/flow/AlwaysTest.java +++ b/core/src/test/java/io/kestra/plugin/core/flow/FinallyTest.java @@ -1,7 +1,5 @@ package io.kestra.plugin.core.flow; -import io.kestra.core.exceptions.InternalException; -import io.kestra.core.junit.annotations.ExecuteFlow; import io.kestra.core.junit.annotations.KestraTest; import io.kestra.core.junit.annotations.LoadFlows; import io.kestra.core.models.executions.Execution; @@ -22,7 +20,7 @@ import static org.hamcrest.Matchers.is; @KestraTest(startRunner = true) -class AlwaysTest { +class FinallyTest { @Inject protected RunnerUtils runnerUtils; @@ -30,11 +28,11 @@ class AlwaysTest { private FlowInputOutput flowIO; @Test - @LoadFlows({"flows/valids/always-sequential.yaml"}) + @LoadFlows({"flows/valids/finally-sequential.yaml"}) void sequentialWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-sequential", null, + "io.kestra.tests", "finally-sequential", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -47,11 +45,11 @@ void sequentialWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-sequential.yaml"}) + @LoadFlows({"flows/valids/finally-sequential.yaml"}) void sequentialWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-sequential", null, + "io.kestra.tests", "finally-sequential", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -64,11 +62,11 @@ void sequentialWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-sequential-error.yaml"}) + @LoadFlows({"flows/valids/finally-sequential-error.yaml"}) void sequentialErrorBlockWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-sequential-error", null, + "io.kestra.tests", "finally-sequential-error", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -81,11 +79,11 @@ void sequentialErrorBlockWithoutErrors() throws QueueException, TimeoutException } @Test - @LoadFlows({"flows/valids/always-sequential-error.yaml"}) + @LoadFlows({"flows/valids/finally-sequential-error.yaml"}) void sequentialErrorBlockWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-sequential-error", null, + "io.kestra.tests", "finally-sequential-error", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -100,11 +98,11 @@ void sequentialErrorBlockWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-allowfailure.yaml"}) + @LoadFlows({"flows/valids/finally-allowfailure.yaml"}) void allowFailureWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-allowfailure", null, + "io.kestra.tests", "finally-allowfailure", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -117,11 +115,11 @@ void allowFailureWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-allowfailure.yaml"}) + @LoadFlows({"flows/valids/finally-allowfailure.yaml"}) void allowFailureWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-allowfailure", null, + "io.kestra.tests", "finally-allowfailure", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -136,11 +134,11 @@ void allowFailureWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-parallel.yaml"}) + @LoadFlows({"flows/valids/finally-parallel.yaml"}) void parallelWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-parallel", null, + "io.kestra.tests", "finally-parallel", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -153,11 +151,11 @@ void parallelWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-parallel.yaml"}) + @LoadFlows({"flows/valids/finally-parallel.yaml"}) void parallelWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-parallel", null, + "io.kestra.tests", "finally-parallel", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -172,13 +170,13 @@ void parallelWithErrors() throws QueueException, TimeoutException { } // @FIXME - @Disabled("ForEach is not working with errors neither always") + @Disabled("ForEach is not working with errors neither finally") @Test - @LoadFlows({"flows/valids/always-foreach.yaml"}) + @LoadFlows({"flows/valids/finally-foreach.yaml"}) void forEachWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-foreach", null, + "io.kestra.tests", "finally-foreach", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -191,13 +189,13 @@ void forEachWithoutErrors() throws QueueException, TimeoutException { } // @FIXME - @Disabled("ForEach is not working with errors neither always") + @Disabled("ForEach is not working with errors neither finally") @Test - @LoadFlows({"flows/valids/always-foreach.yaml"}) + @LoadFlows({"flows/valids/finally-foreach.yaml"}) void forEachWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-foreach", null, + "io.kestra.tests", "finally-foreach", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -212,11 +210,11 @@ void forEachWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-eachparallel.yaml"}) + @LoadFlows({"flows/valids/finally-eachparallel.yaml"}) void eachParallelWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-eachparallel", null, + "io.kestra.tests", "finally-eachparallel", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -229,11 +227,11 @@ void eachParallelWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-eachparallel.yaml"}) + @LoadFlows({"flows/valids/finally-eachparallel.yaml"}) void eachParallelWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-eachparallel", null, + "io.kestra.tests", "finally-eachparallel", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -248,11 +246,11 @@ void eachParallelWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-dag.yaml"}) + @LoadFlows({"flows/valids/finally-dag.yaml"}) void dagWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-dag", null, + "io.kestra.tests", "finally-dag", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -265,11 +263,11 @@ void dagWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-dag.yaml"}) + @LoadFlows({"flows/valids/finally-dag.yaml"}) void dagWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-dag", null, + "io.kestra.tests", "finally-dag", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -284,11 +282,11 @@ void dagWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-flow.yaml"}) + @LoadFlows({"flows/valids/finally-flow.yaml"}) void flowWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-flow", null, + "io.kestra.tests", "finally-flow", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -301,11 +299,11 @@ void flowWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-flow.yaml"}) + @LoadFlows({"flows/valids/finally-flow.yaml"}) void flowWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-flow", null, + "io.kestra.tests", "finally-flow", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); @@ -318,11 +316,11 @@ void flowWithErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-flow-error.yaml"}) + @LoadFlows({"flows/valids/finally-flow-error.yaml"}) void flowErrorBlockWithoutErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-flow-error", null, + "io.kestra.tests", "finally-flow-error", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", false)), Duration.ofSeconds(60) ); @@ -335,11 +333,11 @@ void flowErrorBlockWithoutErrors() throws QueueException, TimeoutException { } @Test - @LoadFlows({"flows/valids/always-flow-error.yaml"}) + @LoadFlows({"flows/valids/finally-flow-error.yaml"}) void flowErrorBlockWithErrors() throws QueueException, TimeoutException { Execution execution = runnerUtils.runOne( null, - "io.kestra.tests", "always-flow-error", null, + "io.kestra.tests", "finally-flow-error", null, (flow, execution1) -> flowIO.readExecutionInputs(flow, execution1, Map.of("failed", true)), Duration.ofSeconds(60) ); diff --git a/core/src/test/resources/flows/valids/always-allowfailure.yaml b/core/src/test/resources/flows/valids/finally-allowfailure.yaml similarity index 95% rename from core/src/test/resources/flows/valids/always-allowfailure.yaml rename to core/src/test/resources/flows/valids/finally-allowfailure.yaml index c8386503e81..9812dc21da6 100644 --- a/core/src/test/resources/flows/valids/always-allowfailure.yaml +++ b/core/src/test/resources/flows/valids/finally-allowfailure.yaml @@ -1,4 +1,4 @@ -id: always-allowfailure +id: finally-allowfailure namespace: io.kestra.tests inputs: @@ -30,7 +30,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-dag.yaml b/core/src/test/resources/flows/valids/finally-dag.yaml similarity index 97% rename from core/src/test/resources/flows/valids/always-dag.yaml rename to core/src/test/resources/flows/valids/finally-dag.yaml index 0d18cc87dc7..94dad1d57ab 100644 --- a/core/src/test/resources/flows/valids/always-dag.yaml +++ b/core/src/test/resources/flows/valids/finally-dag.yaml @@ -1,4 +1,4 @@ -id: always-dag +id: finally-dag namespace: io.kestra.tests inputs: @@ -43,7 +43,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-eachparallel.yaml b/core/src/test/resources/flows/valids/finally-eachparallel.yaml similarity index 96% rename from core/src/test/resources/flows/valids/always-eachparallel.yaml rename to core/src/test/resources/flows/valids/finally-eachparallel.yaml index 0090b225bf0..72a13d45b99 100644 --- a/core/src/test/resources/flows/valids/always-eachparallel.yaml +++ b/core/src/test/resources/flows/valids/finally-eachparallel.yaml @@ -1,4 +1,4 @@ -id: always-eachparallel +id: finally-eachparallel namespace: io.kestra.tests inputs: @@ -31,7 +31,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-flow-error.yaml b/core/src/test/resources/flows/valids/finally-flow-error.yaml similarity index 95% rename from core/src/test/resources/flows/valids/always-flow-error.yaml rename to core/src/test/resources/flows/valids/finally-flow-error.yaml index f6aaded1c6b..0c80a1db323 100644 --- a/core/src/test/resources/flows/valids/always-flow-error.yaml +++ b/core/src/test/resources/flows/valids/finally-flow-error.yaml @@ -1,4 +1,4 @@ -id: always-flow-error +id: finally-flow-error namespace: io.kestra.tests inputs: @@ -27,7 +27,7 @@ errors: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" -always: +finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-flow.yaml b/core/src/test/resources/flows/valids/finally-flow.yaml similarity index 95% rename from core/src/test/resources/flows/valids/always-flow.yaml rename to core/src/test/resources/flows/valids/finally-flow.yaml index c703d75b44e..0bb8848bda7 100644 --- a/core/src/test/resources/flows/valids/always-flow.yaml +++ b/core/src/test/resources/flows/valids/finally-flow.yaml @@ -1,4 +1,4 @@ -id: always-flow +id: finally-flow namespace: io.kestra.tests inputs: @@ -18,7 +18,7 @@ tasks: - id: ko type: io.kestra.plugin.core.execution.Fail -always: +finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-foreach.yaml b/core/src/test/resources/flows/valids/finally-foreach.yaml similarity index 96% rename from core/src/test/resources/flows/valids/always-foreach.yaml rename to core/src/test/resources/flows/valids/finally-foreach.yaml index 1b1897eedf9..6da024c31b1 100644 --- a/core/src/test/resources/flows/valids/always-foreach.yaml +++ b/core/src/test/resources/flows/valids/finally-foreach.yaml @@ -1,4 +1,4 @@ -id: always-foreach +id: finally-foreach namespace: io.kestra.tests inputs: @@ -32,7 +32,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-parallel.yaml b/core/src/test/resources/flows/valids/finally-parallel.yaml similarity index 97% rename from core/src/test/resources/flows/valids/always-parallel.yaml rename to core/src/test/resources/flows/valids/finally-parallel.yaml index 8974cd43d20..71b6e8ff45b 100644 --- a/core/src/test/resources/flows/valids/always-parallel.yaml +++ b/core/src/test/resources/flows/valids/finally-parallel.yaml @@ -1,4 +1,4 @@ -id: always-parallel +id: finally-parallel namespace: io.kestra.tests inputs: @@ -39,7 +39,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-sequential-error.yaml b/core/src/test/resources/flows/valids/finally-sequential-error.yaml similarity index 95% rename from core/src/test/resources/flows/valids/always-sequential-error.yaml rename to core/src/test/resources/flows/valids/finally-sequential-error.yaml index 9ba0652d03b..6df76defa07 100644 --- a/core/src/test/resources/flows/valids/always-sequential-error.yaml +++ b/core/src/test/resources/flows/valids/finally-sequential-error.yaml @@ -1,4 +1,4 @@ -id: always-sequential-error +id: finally-sequential-error namespace: io.kestra.tests inputs: @@ -30,7 +30,7 @@ tasks: type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}" diff --git a/core/src/test/resources/flows/valids/always-sequential.yaml b/core/src/test/resources/flows/valids/finally-sequential.yaml similarity index 94% rename from core/src/test/resources/flows/valids/always-sequential.yaml rename to core/src/test/resources/flows/valids/finally-sequential.yaml index d54e8eff63f..a79e50116f3 100644 --- a/core/src/test/resources/flows/valids/always-sequential.yaml +++ b/core/src/test/resources/flows/valids/finally-sequential.yaml @@ -1,4 +1,4 @@ -id: always-sequential +id: finally-sequential namespace: io.kestra.tests inputs: @@ -21,7 +21,7 @@ tasks: - id: ko type: io.kestra.plugin.core.execution.Fail - always: + finally: - id: a1 type: io.kestra.plugin.core.debug.Return format: "{{ task.id }}"