use of com.epam.pipeline.entity.pipeline.PipelineRun in project cloud-pipeline by epam.
the class FirecloudRunner method runAnalysis.
@Override
public List<PipelineRun> runAnalysis(AnalysisConfiguration<FirecloudRunConfigurationEntry> configuration) {
Assert.state(CollectionUtils.isNotEmpty(configuration.getEntitiesIds()), "Entities are required to run analysis in Firecloud");
FolderWithMetadata project = folderManager.getProject(configuration.getConfigurationId(), AclClass.CONFIGURATION);
Assert.notNull(project, "Project folder must be specified to run analysis in Firecloud.");
List<Long> entities = parameterMapper.fetchAndExpandInputEntities(configuration).values().stream().flatMap(Collection::stream).map(BaseEntity::getId).collect(Collectors.toList());
// TODO: after merge - add check that FC class is filled
configuration.getEntries().forEach(this::validateFirecloudConfiguration);
FirecloudConfiguration settings = buildFirecloudConfig(configuration.getRefreshToken());
return configuration.getEntries().stream().map(entry -> runFirecloudAnalysis(settings, entry, configuration.getConfigurationId(), entities, project.getId())).collect(Collectors.toList());
}
use of com.epam.pipeline.entity.pipeline.PipelineRun in project cloud-pipeline by epam.
the class GrantPermissionManager method runPermission.
public boolean runPermission(Long runId, String permissionName) {
PipelineRun pipelineRun = runManager.loadPipelineRun(runId);
if (permissionsHelper.isOwner(pipelineRun)) {
return true;
}
AbstractSecuredEntity parent = pipelineRun.getParent();
if (parent == null) {
return false;
}
return permissionEvaluator.hasPermission(SecurityContextHolder.getContext().getAuthentication(), parent, permissionName);
}
use of com.epam.pipeline.entity.pipeline.PipelineRun in project cloud-pipeline by epam.
the class PipelineRunDaoTest method testUpdateWithPrettyUrlRun.
@Test
public void testUpdateWithPrettyUrlRun() {
PipelineRun run = createTestPipelineRun(testPipeline.getId());
run.setPrettyUrl(PRETTY_URL);
pipelineRunDao.updateRun(run);
PipelineRun loaded = pipelineRunDao.loadPipelineRun(run.getId());
assertEquals(run.getId(), loaded.getId());
assertEquals(PRETTY_URL, loaded.getPrettyUrl());
Optional<PipelineRun> runByPrettyUrl = pipelineRunDao.loadRunByPrettyUrl(PRETTY_URL);
assertTrue(runByPrettyUrl.isPresent());
assertEquals(run.getId(), runByPrettyUrl.get().getId());
}
use of com.epam.pipeline.entity.pipeline.PipelineRun in project cloud-pipeline by epam.
the class PipelineRunDaoTest method updateRunStatus.
@Test
public void updateRunStatus() {
PipelineRun run = createTestPipelineRun();
run.setStatus(TaskStatus.SUCCESS);
run.setEndDate(new Date());
run.setTerminating(true);
pipelineRunDao.updateRunStatus(run);
PipelineRun loadedRun = pipelineRunDao.loadPipelineRun(run.getId());
assertEquals(run.getEndDate(), loadedRun.getEndDate());
assertEquals(run.getStatus(), loadedRun.getStatus());
assertEquals(run.isTerminating(), loadedRun.isTerminating());
}
use of com.epam.pipeline.entity.pipeline.PipelineRun in project cloud-pipeline by epam.
the class PipelineRunDaoTest method testLoadRunWithoutPipeline.
@Test
public void testLoadRunWithoutPipeline() {
PipelineRun run = createTestPipelineRun(null);
PipelineRun loadedRun = pipelineRunDao.loadPipelineRun(run.getId());
assertNull(loadedRun.getPipelineId());
}
Aggregations