Search in sources :

Example 6 with PipelineDependencyGraphOld

use of com.thoughtworks.go.domain.PipelineDependencyGraphOld in project gocd by gocd.

the class PipelineHistoryService method pipelineDependencyGraph.

public PipelineDependencyGraphOld pipelineDependencyGraph(String pipelineName, int pipelineCounter, final Username username, OperationResult result) {
    if (!validate(pipelineName, username, result)) {
        return null;
    }
    PipelineDependencyGraphOld graph = pipelineDao.pipelineGraphByNameAndCounter(pipelineName, pipelineCounter);
    if (graph == null) {
        String message = String.format("Pipeline [%s] with counter [%s] is not found", pipelineName, pipelineCounter);
        result.notFound(message, message, HealthStateType.general(HealthStateScope.forPipeline(pipelineName)));
        return null;
    }
    removePipelinesThatAreNotInConfig(username, graph);
    addConfiguredPipelinesThatAreNotRunYet(username, graph, goConfigService.downstreamPipelinesOf(pipelineName));
    populatePipelineState(graph.pipeline(), username);
    for (PipelineInstanceModel pipelineInstanceModel : graph.dependencies()) {
        populateDownstreamPipelineState(username, pipelineInstanceModel);
    }
    return graph;
}
Also used : PipelineDependencyGraphOld(com.thoughtworks.go.domain.PipelineDependencyGraphOld)

Aggregations

PipelineDependencyGraphOld (com.thoughtworks.go.domain.PipelineDependencyGraphOld)6 PipelineInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel)4 Test (org.junit.Test)4 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)3 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)3 StageInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel)3 StageInstanceModels (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModels)3 PipelineInstanceModels (com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels)1 TreeSet (java.util.TreeSet)1