import org.sonar.db.alm.setting.ALM;
import org.sonar.db.alm.setting.AlmSettingDto;
import org.sonar.server.user.UserSession;
-import org.sonarqube.ws.AlmSettings;
import org.sonarqube.ws.AlmSettings.AlmSettingBitbucketCloud;
import org.sonarqube.ws.AlmSettings.AlmSettingGithub;
validateBitbucketServer(almSettingDto);
break;
case BITBUCKET_CLOUD:
- validateBitbucketCloud(almSettingDto);
+ // TODO implement
+ break;
case AZURE_DEVOPS:
validateAzure(almSettingDto);
break;
bitbucketServerRestClient.validateToken(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
bitbucketServerRestClient.validateReadPermission(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
}
-
- private void validateBitbucketCloud(AlmSettingDto almSettingDto) {
- bitbucketServerRestClient.validateUrl(almSettingDto.getUrl());
- bitbucketServerRestClient.validateToken(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
- bitbucketServerRestClient.validateReadPermission(almSettingDto.getUrl(), almSettingDto.getPersonalAccessToken());
- }
}
public String getPublicRootUrl() {
String baseUrl = trimToEmpty(settings.get(CoreProperties.SERVER_BASE_URL).orElse(""));
if (baseUrl.isEmpty()) {
- // If server base URL was not configured in Sonar server then is is better to take URL configured on batch side
+ // If server base URL was not configured in Sonar server then it is better to take URL configured on batch side
baseUrl = client.baseUrl();
}
return StringUtils.removeEnd(baseUrl, "/");