use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildConfigurationSetForCancel.
public BuildConfigurationSet buildConfigurationSetForCancel(Integer configurationSetId) {
BuildConfigurationSet buildConfigurationSet = new BuildConfigurationSet();
buildConfigurationSet.setName("test-build-cancel-configuration");
buildConfigurationSet.setId(configurationSetId);
buildConfigurationForCancelling(buildConfigurationSet);
return buildConfigurationSet;
}
use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildConfigurationSetWithFailedDependencies.
public BuildConfigurationSet buildConfigurationSetWithFailedDependencies(Integer configurationSetId) {
BuildConfigurationSet buildConfigurationSet = new BuildConfigurationSet();
buildConfigurationSet.setName("test-build-configuration-failed-deps");
buildConfigurationSet.setId(configurationSetId);
buildConfigurationWithDependenciesThatFail(buildConfigurationSet);
return buildConfigurationSet;
}
use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.
the class GroupConfigurationProviderTest method fill.
@Before
public void fill() {
final BuildConfigurationSet a = prepareBuildConfigSet("Wu-tang clan", false);
final BuildConfigurationSet b = prepareBuildConfigSet("Ain't nothing", false);
final BuildConfigurationSet c = prepareBuildConfigSet("To frick with!", false);
List<BuildConfigurationSet> configs = new ArrayList<>(Arrays.asList(new BuildConfigurationSet[] { a, b, c, bcs }));
fillRepository(configs);
}
use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.
the class BuildConfigurationProviderImpl method restoreRevision.
@Override
public Optional<BuildConfiguration> restoreRevision(String id, int rev) {
IdRev idRev = new IdRev(Integer.valueOf(id), rev);
BuildConfigurationAudited buildConfigurationAudited = buildConfigurationAuditedRepository.queryById(idRev);
org.jboss.pnc.model.BuildConfiguration originalBC = repository.queryById(Integer.valueOf(id));
org.jboss.pnc.model.User user = userService.currentUser();
if (buildConfigurationAudited == null || originalBC == null) {
return Optional.empty();
}
originalBC.setName(buildConfigurationAudited.getName());
originalBC.setBuildScript(buildConfigurationAudited.getBuildScript());
originalBC.setRepositoryConfiguration(buildConfigurationAudited.getRepositoryConfiguration());
originalBC.setScmRevision(buildConfigurationAudited.getScmRevision());
originalBC.setBuildType(buildConfigurationAudited.getBuildType());
originalBC.setBuildEnvironment(buildConfigurationAudited.getBuildEnvironment());
originalBC.setGenericParameters(buildConfigurationAudited.getGenericParameters());
originalBC.setLastModificationUser(user);
org.jboss.pnc.model.BuildConfiguration newBc = repository.save(originalBC);
newBc.getBuildConfigurationSets().forEach(BuildConfigurationSet::getId);
newBc.getDependencies().forEach(org.jboss.pnc.model.BuildConfiguration::getId);
repository.flushAndRefresh(newBc);
return Optional.of(mapper.toDTO(newBc));
}
use of org.jboss.pnc.model.BuildConfigurationSet in project pnc by project-ncl.
the class GroupConfigurationProviderImpl method validateBeforeUpdating.
@Override
protected void validateBeforeUpdating(Integer id, GroupConfiguration restEntity) {
super.validateBeforeUpdating(id, restEntity);
BuildConfigurationSet dbEntity = findInDB(id);
if (dbEntity.isArchived()) {
throw new RepositoryViolationException("The Group Config " + id + " is already deleted.");
}
}
Aggregations