public void define(WebService.NewController context) {
WebService.NewAction action = context.createAction("import_azure_project")
.setDescription("Create a SonarQube project with the information from the provided Azure DevOps project.<br/>" +
- "Autoconfigure pull request decoration mechanism.<br/>" +
- "Requires the 'Create Projects' permission")
+ "Autoconfigure pull request decoration mechanism.<br/>" +
+ "Requires the 'Create Projects' permission")
.setPost(true)
.setInternal(true)
.setSince("8.6")
boolean visibility = projectDefaultVisibility.get(dbSession).isPrivate();
String uniqueProjectKey = projectKeyGenerator.generateUniqueProjectKey(repo.getProject().getName(), repo.getName());
return componentUpdater.createWithoutCommit(dbSession, newComponentBuilder()
- .setKey(uniqueProjectKey)
- .setName(repo.getName())
- .setPrivate(visibility)
- .setQualifier(PROJECT)
- .build(),
+ .setKey(uniqueProjectKey)
+ .setName(repo.getName())
+ .setPrivate(visibility)
+ .setQualifier(PROJECT)
+ .build(),
userSession.isLoggedIn() ? userSession.getUuid() : null,
userSession.isLoggedIn() ? userSession.getLogin() : null,
repo.getDefaultBranchName());
}
public void createNewCodeDefinition(DbSession dbSession, String projectUuid, String mainBranchUuid,
- String defaultBranchName, String newCodeDefinitionType, String newCodeDefinitionValue) {
+ String defaultBranchName, String newCodeDefinitionType, @Nullable String newCodeDefinitionValue) {
boolean isCommunityEdition = editionProvider.get().filter(EditionProvider.Edition.COMMUNITY::equals).isPresent();
NewCodePeriodType newCodePeriodType = parseNewCodeDefinitionType(newCodeDefinitionType);
import org.sonar.server.user.UserSession;
import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static java.lang.Math.min;
import static java.lang.String.format;
import static java.util.stream.Collectors.toSet;
try {
entities.forEach(p -> componentCleanerService.deleteEntity(dbSession, p));
} finally {
- callDeleteListeners(dbSession, mainBranchUuidByEntityUuid, entities);
+ callDeleteListeners(mainBranchUuidByEntityUuid, entities);
}
}
response.noContent();
}
- private void callDeleteListeners(DbSession dbSession, Map<String, String> mainBranchUuidByEntityUuid , List<EntityDto> entities) {
+ private void callDeleteListeners(Map<String, String> mainBranchUuidByEntityUuid , List<EntityDto> entities) {
Set<DeletedProject> deletedProjects = entities.stream().map(entity -> new DeletedProject(Project.from(entity),
mainBranchUuidByEntityUuid.get(entity.getUuid()))).collect(toSet());
projectLifeCycleListeners.onProjectsDeleted(deletedProjects);