Skip to content

Commit

Permalink
Use PipelinesWorkflow to build following steps
Browse files Browse the repository at this point in the history
Add extra filter to filter empty stepsToRun
  • Loading branch information
muttcg committed Apr 8, 2024
1 parent 95b7ee0 commit 638f92c
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -267,6 +266,7 @@ private Set<StepType> prioritizeSteps(Set<StepType> steps, Dataset dataset) {
@VisibleForTesting
Optional<PipelineStep> getLatestSuccessfulStep(PipelineProcess pipelineProcess, StepType step) {
return pipelineProcess.getExecutions().stream()
.filter(ex-> !ex.getStepsToRun().isEmpty())
.sorted(Comparator.comparing(PipelineExecution::getCreated).reversed())
.flatMap(ex -> ex.getSteps().stream())
.filter(s -> step.equals(s.getType()))
Expand Down Expand Up @@ -430,11 +430,7 @@ public RunPipelineResponse runPipelineAttempt(
.build();
}

Set<StepType> finalSteps =
stepsToSend.entrySet().stream()
.flatMap(x -> x.getValue().getPipelineSteps().stream())
.map(StepType::valueOf)
.collect(Collectors.toSet());
Set<StepType> finalSteps = PipelinesWorkflow.getOccurrenceWorkflow().getAllNodesFor(stepsToSend.keySet());

// create pipelines execution
PipelineExecution execution =
Expand Down

0 comments on commit 638f92c

Please sign in to comment.