use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.
the class PipelineHistoryMother method pipeline.
public static PipelineModel pipeline() {
PipelineModel pipelineModel = new PipelineModel("pipe1", true, true, PipelinePauseInfo.notPaused());
MaterialRevisions materialRevisions = ModificationsMother.createHgMaterialRevisions();
PipelineInstanceModel instanceModel = PipelineInstanceModel.createPipeline("pipe1", -1, "label1", BuildCause.createWithModifications(materialRevisions, "foo-bar"), new StageInstanceModels());
instanceModel.setMaterialConfigs(new MaterialConfigs(materialRevisions.getMaterialRevision(0).getMaterial().config()));
instanceModel.setLatestRevisions(materialRevisions);
pipelineModel.addPipelineInstance(instanceModel);
return pipelineModel;
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.
the class GoDashboardCurrentStateLoader method instancesFor.
private PipelineInstanceModels instancesFor(PipelineConfig pipelineConfig, PipelineInstanceModels historyForDashboard) {
PipelineInstanceModels pims = findPIMsWithFallbacks(pipelineConfig, historyForDashboard);
boolean isCurrentlyLocked = pipelineLockService.isLocked(str(pipelineConfig.name()));
boolean isUnlockable = pipelineUnlockApiService.isUnlockable(str(pipelineConfig.name()));
for (PipelineInstanceModel instanceModel : pims) {
populateStagesWhichHaventRunFromConfig(instanceModel, pipelineConfig);
populateLockStatus(instanceModel, pipelineConfig.isLockable(), isCurrentlyLocked, isUnlockable);
}
return pims;
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.
the class PipelineSqlMapDao method loadHistoryByIdWithBuildCause.
public PipelineInstanceModel loadHistoryByIdWithBuildCause(Long id) {
PipelineInstanceModel model = loadHistory(id);
loadPipelineHistoryBuildCause(model);
return model;
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.
the class PipelineSqlMapDao method loadHistory.
private PipelineInstanceModels loadHistory(String pipelineName, List<Long> ids) {
if (ids.isEmpty()) {
return PipelineInstanceModels.createPipelineInstanceModels();
}
Map<String, Object> args = arguments("pipelineName", pipelineName).and("from", Collections.min(ids)).and("to", Collections.max(ids)).asMap();
PipelineInstanceModels history = PipelineInstanceModels.createPipelineInstanceModels((List<PipelineInstanceModel>) getSqlMapClientTemplate().queryForList("getPipelineHistoryByName", args));
for (PipelineInstanceModel pipelineInstanceModel : history) {
loadPipelineHistoryBuildCause(pipelineInstanceModel);
}
return history;
}
use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.
the class PipelineSqlMapDao method groupPipelineInstanceIdsByPipelineName.
private Map<String, TreeSet<Long>> groupPipelineInstanceIdsByPipelineName(List<PipelineInstanceModel> pipelines) {
Map<String, TreeSet<Long>> result;
result = new HashMap<String, TreeSet<Long>>();
for (PipelineInstanceModel pipeline : pipelines) {
TreeSet<Long> ids = initializePipelineInstances(result, pipeline.getName());
ids.add(pipeline.getId());
}
return result;
}
Aggregations