From 96734b73d0482b0f1b002e8c73439e635490e074 Mon Sep 17 00:00:00 2001 From: Michael Clarke Date: Sun, 31 Dec 2023 12:29:52 +0000 Subject: [PATCH] #829: Add support for Sonarqube 10.3 The constants in `CeTaskCharacteristicsDto` have been moved into a new class `CeTaskCharacteristics`, so the references in the plugin have been updated. --- .env | 2 +- build.gradle | 2 +- .../server/CommunityBranchSupportDelegate.java | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 8612f3684..7de99fb74 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # The Sonarqube base image. 'latest' if building locally, '8.5-community' if targeting a specific version -SONARQUBE_VERSION=10.2-community +SONARQUBE_VERSION=10.3-community # The name of the Dockerfile to run. 'Dockerfile' is building locally, 'release.Dockerfile' if building the release image DOCKERFILE=Dockerfile diff --git a/build.gradle b/build.gradle index 7581091c1..e23bea6db 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ repositories { } } -def sonarqubeVersion = '10.2.1.78527' +def sonarqubeVersion = '10.3.0.82913' def sonarqubeLibDir = "${projectDir}/sonarqube-lib" def sonarLibraries = "${sonarqubeLibDir}/sonarqube-${sonarqubeVersion}/lib" diff --git a/src/main/java/com/github/mc1arke/sonarqube/plugin/server/CommunityBranchSupportDelegate.java b/src/main/java/com/github/mc1arke/sonarqube/plugin/server/CommunityBranchSupportDelegate.java index f09e62465..2aaebf599 100644 --- a/src/main/java/com/github/mc1arke/sonarqube/plugin/server/CommunityBranchSupportDelegate.java +++ b/src/main/java/com/github/mc1arke/sonarqube/plugin/server/CommunityBranchSupportDelegate.java @@ -26,11 +26,11 @@ import org.apache.commons.lang.StringUtils; import org.sonar.api.config.Configuration; +import org.sonar.core.ce.CeTaskCharacteristics; import org.sonar.core.config.PurgeConstants; import org.sonar.core.util.UuidFactory; import org.sonar.db.DbClient; import org.sonar.db.DbSession; -import org.sonar.db.ce.CeTaskCharacteristicDto; import org.sonar.db.component.BranchDto; import org.sonar.db.component.BranchType; import org.sonar.db.component.ComponentDto; @@ -59,20 +59,20 @@ public CommunityBranchSupportDelegate(UuidFactory uuidFactory, DbClient dbClient @Override public CommunityComponentKey createComponentKey(String projectKey, Map characteristics) { - String branchTypeParam = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristicDto.BRANCH_TYPE_KEY)); + String branchTypeParam = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristics.BRANCH_TYPE)); if (null == branchTypeParam) { - String pullRequest = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristicDto.PULL_REQUEST)); + String pullRequest = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristics.PULL_REQUEST)); if (null == pullRequest) { throw new IllegalArgumentException(String.format("One of '%s' or '%s' parameters must be specified", - CeTaskCharacteristicDto.BRANCH_TYPE_KEY, - CeTaskCharacteristicDto.PULL_REQUEST)); + CeTaskCharacteristics.BRANCH_TYPE, + CeTaskCharacteristics.PULL_REQUEST)); } else { return new CommunityComponentKey(projectKey, null, pullRequest); } } - String branch = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristicDto.BRANCH_KEY)); + String branch = StringUtils.trimToNull(characteristics.get(CeTaskCharacteristics.BRANCH)); try { BranchType.valueOf(branchTypeParam);