use of com.thoughtworks.go.server.presentation.models.StageJsonPresentationModel in project gocd by gocd.
the class CachedCurrentActivityService method stagesModel.
private List<StageJsonPresentationModel> stagesModel(PipelineConfig pipelineConfig) {
List<StageJsonPresentationModel> presenters = new ArrayList<>();
for (StageConfig stageConfig : pipelineConfig) {
Stage mostRecentStage = stageService.mostRecentStageWithBuilds(CaseInsensitiveString.str(pipelineConfig.name()), stageConfig);
Pipeline pipeline = pipelineService.pipelineWithModsByStageId(CaseInsensitiveString.str(pipelineConfig.name()), mostRecentStage.getId());
presenters.add(stageModel(pipeline, mostRecentStage));
}
return presenters;
}
use of com.thoughtworks.go.server.presentation.models.StageJsonPresentationModel in project gocd by gocd.
the class CachedCurrentActivityService method pipelineModel.
private PipelineJsonPresentationModel pipelineModel(PipelineConfig pipelineConfig) {
String name = CaseInsensitiveString.str(pipelineConfig.name());
PipelinePauseInfo pauseInfo = pipelinePauseService.pipelinePauseInfo(name);
boolean forcedBuild = pipelineScheduleQueue.hasForcedBuildCause(name);
List<StageJsonPresentationModel> stageModels = stagesModel(pipelineConfig);
return new PipelineJsonPresentationModel(goConfigService.findGroupNameByPipeline(new CaseInsensitiveString(name)), name, pauseInfo, forcedBuild, stageModels);
}
use of com.thoughtworks.go.server.presentation.models.StageJsonPresentationModel in project gocd by gocd.
the class CachedCurrentActivityService method stageModel.
private StageJsonPresentationModel stageModel(Pipeline currentPipeline, Stage stage) {
StageIdentifier lastSuccessfulPipelineForStage = pipelineService.findLastSuccessfulStageIdentifier(currentPipeline.getName(), stage.getName());
final DurationBeans durations = stageService.getBuildDurations(currentPipeline.getName(), stage);
TrackingTool trackingTool = goConfigService.pipelineConfigNamed(new CaseInsensitiveString(currentPipeline.getName())).trackingTool();
return new StageJsonPresentationModel(currentPipeline, stage, lastSuccessfulPipelineForStage, goConfigService.agents(), durations, trackingTool);
}
Aggregations