Skip to content

Commit

Permalink
fix(pipeline_template): Resave all pipelines on template update (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert authored Nov 2, 2017
1 parent 5fefb46 commit 3476e5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.netflix.spinnaker.orca.pipelinetemplate.tasks.PlanTemplateDependentsTask;
import com.netflix.spinnaker.orca.pipelinetemplate.tasks.UpdatePipelineTemplateTask;
import com.netflix.spinnaker.orca.pipelinetemplate.v1schema.model.PipelineTemplate;
import com.netflix.spinnaker.orca.pipelinetemplate.v1schema.model.TemplateConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -85,11 +84,6 @@ public <T extends Execution<T>> List<Stage<T>> aroundStages(@Nonnull Stage<T> st
List<Map<String, Object>> dependentPipelines = front50Service.getPipelineTemplateDependents(pipelineTemplate.getId(), true);

return dependentPipelines.stream()
.filter(pipeline -> {
// We only need to re-save pipelines that actually inherit configurations.
TemplateConfiguration config = pipelineTemplateObjectMapper.convertValue(pipeline.get("config"), TemplateConfiguration.class);
return !config.getConfiguration().getInherit().isEmpty();
})
.map(pipeline -> configureSavePipelineStage(stage, pipeline))
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class UpdatePipelineTemplateStageSpec extends Specification {
[pipeline1, pipeline2, pipeline3]
}

afterStages.size() == 2
afterStages*.name == ['updateDependentPipeline', 'updateDependentPipeline']
afterStages.size() == 3
beforeStages.size() == 0
}
}

0 comments on commit 3476e5e

Please sign in to comment.