Skip to content

Commit

Permalink
#829: Add support for Sonarqube 10.3
Browse files Browse the repository at this point in the history
The constants in `CeTaskCharacteristicsDto` have been moved into a new
class `CeTaskCharacteristics`, so the references in the plugin have
been updated.
  • Loading branch information
mc1arke committed Dec 31, 2023
1 parent 7dc4be9 commit 96734b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -59,20 +59,20 @@ public CommunityBranchSupportDelegate(UuidFactory uuidFactory, DbClient dbClient

@Override
public CommunityComponentKey createComponentKey(String projectKey, Map<String, String> 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);
Expand Down

0 comments on commit 96734b7

Please sign in to comment.