]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14396 Decorate PRs in Bitbucket Cloud
authorMichal Duda <michal.duda@sonarsource.com>
Wed, 27 Jan 2021 17:05:47 +0000 (18:05 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 8 Feb 2021 20:07:45 +0000 (20:07 +0000)
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ListDefinitionsAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/almsettings/ws/ValidateAction.java
sonar-scanner-engine/src/main/java/org/sonar/scanner/platform/DefaultServer.java

index 1e66f542c5de5ebde7c9174f55cb7632c5b7f220..0e71eb9633e75756c3402a06c4b79816a617c6b1 100644 (file)
@@ -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;
 
index 34cbe3814f0c84e6eca5744705c3b82063250f88..add468e10657627ba1f8af5756e51e37ad4408f8 100644 (file)
@@ -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());
-  }
 }
index 8be289a699b7aacc539c77dfd2e08d0a43345cbf..77e294a2ff5db72441e3666a0c0fb1b362cbd68b 100644 (file)
@@ -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, "/");