Change complete when _all_ instances have it, not _any_
@@ -565,13 +565,13 @@ public class DeploymentTrigger {
: steps.productionJobs();
Change change = application.change();
- for (Instance instance : application.instances().values()) {
- if (jobs.stream().allMatch(job -> isComplete(application.change().withoutApplication(), application.change(), instance, job)))
+ if (application.instances().values().stream().allMatch(instance ->
+ jobs.stream().allMatch(job -> isComplete(application.change().withoutApplication(), application.change(), instance, job))))
change = change.withoutPlatform();
- if (jobs.stream().allMatch(job -> isComplete(application.change().withoutPlatform(), application.change(), instance, job)))
+ if (application.instances().values().stream().allMatch(instance ->
+ jobs.stream().allMatch(job -> isComplete(application.change().withoutPlatform(), application.change(), instance, job))))
change = change.withoutApplication();
- }
return change;
}
