From b034d100caf1423aeb5f4d8e65d8822e86ecaf1e 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 | 4 ++-- .../server/CommunityBranchSupportDelegate.java | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 3d68f9bec..4680192d0 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 1bd7943d5..5da591535 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Michael Clarke + * Copyright (C) 2020-2024 Michael Clarke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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..80b41aee2 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 Michael Clarke + * Copyright (C) 2020-2024 Michael Clarke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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);