From: Michal Duda Date: Wed, 27 Jan 2021 17:05:47 +0000 (+0100) Subject: SONAR-14396 Decorate PRs in Bitbucket Cloud X-Git-Tag: 8.7.0.41497~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce56313561f86d0c15ca6efd0fdf70971bbdba62;p=sonarqube.git SONAR-14396 Decorate PRs in Bitbucket Cloud --- diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ListDefinitionsAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ListDefinitionsAction.java index 1e66f542c5d..0e71eb9633e 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ListDefinitionsAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ListDefinitionsAction.java @@ -33,7 +33,6 @@ import org.sonar.db.DbSession; 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; diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ValidateAction.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ValidateAction.java index 34cbe3814f0..add468e1065 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ValidateAction.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ValidateAction.java @@ -97,7 +97,8 @@ public class ValidateAction implements AlmSettingsWsAction { validateBitbucketServer(almSettingDto); break; case BITBUCKET_CLOUD: - validateBitbucketCloud(almSettingDto); + // TODO implement + break; case AZURE_DEVOPS: validateAzure(almSettingDto); break; @@ -144,10 +145,4 @@ public class ValidateAction implements AlmSettingsWsAction { 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()); - } } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java index 8be289a699b..77e294a2ff5 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java @@ -73,7 +73,7 @@ public class DefaultServer extends Server { 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, "/");