From 8d858dd3b7c87e5a39d8031d527a723d5191ba53 Mon Sep 17 00:00:00 2001 From: Alain Kermis Date: Tue, 9 Jul 2024 16:16:42 +0200 Subject: [PATCH] SONAR-22479 Refactored new telemetry model --- .../QualityProfileDataProviderIT.java | 2 +- .../TelemetryDataLoaderImplIT.java | 12 +++++----- .../java/org/sonar}/telemetry/Dimension.java | 2 +- .../org/sonar}/telemetry/Granularity.java | 2 +- .../telemetry/TelemetryDataProvider.java | 6 ++--- .../sonar}/telemetry/TelemetryDataType.java | 2 +- .../CloudUsageDataProvider.java | 2 +- .../QualityProfileDataProvider.java | 2 +- .../TelemetryClient.java | 2 +- .../TelemetryDaemon.java | 2 +- .../{deprecated => legacy}/TelemetryData.java | 2 +- .../TelemetryDataJsonWriter.java | 2 +- .../TelemetryDataLoader.java | 2 +- .../TelemetryDataLoaderImpl.java | 8 +++---- .../{deprecated => legacy}/package-info.java | 2 +- .../org/sonar/telemetry/package-info.java | 23 +++++++++++++++++++ .../CloudUsageDataProviderTest.java | 10 ++++---- .../{deprecated => legacy}/FakeServer.java | 2 +- .../TelemetryClientCompressionTest.java | 2 +- .../TelemetryClientTest.java | 2 +- .../TelemetryDaemonTest.java | 2 +- .../TelemetryDataJsonWriterTest.java | 2 +- .../{deprecated => legacy}/dummy.crt | 0 .../platformlevel/PlatformLevel4.java | 12 +++++----- .../telemetry/TelemetryVersionProvider.java | 8 +++---- .../TelemetryVersionProviderTest.java | 6 +++-- 26 files changed, 72 insertions(+), 47 deletions(-) rename server/sonar-telemetry/src/it/java/org/sonar/telemetry/{deprecated => legacy}/QualityProfileDataProviderIT.java (99%) rename server/sonar-telemetry/src/it/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDataLoaderImplIT.java (98%) rename server/{sonar-server-common/src/main/java/org/sonar/server => sonar-telemetry/src/main/java/org/sonar}/telemetry/Dimension.java (97%) rename server/{sonar-server-common/src/main/java/org/sonar/server => sonar-telemetry/src/main/java/org/sonar}/telemetry/Granularity.java (97%) rename server/{sonar-server-common/src/main/java/org/sonar/server => sonar-telemetry/src/main/java/org/sonar}/telemetry/TelemetryDataProvider.java (94%) rename server/{sonar-server-common/src/main/java/org/sonar/server => sonar-telemetry/src/main/java/org/sonar}/telemetry/TelemetryDataType.java (96%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/CloudUsageDataProvider.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/QualityProfileDataProvider.java (98%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryClient.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDaemon.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryData.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDataJsonWriter.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDataLoader.java (95%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDataLoaderImpl.java (99%) rename server/sonar-telemetry/src/main/java/org/sonar/telemetry/{deprecated => legacy}/package-info.java (95%) create mode 100644 server/sonar-telemetry/src/main/java/org/sonar/telemetry/package-info.java rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/CloudUsageDataProviderTest.java (95%) rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/FakeServer.java (97%) rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryClientCompressionTest.java (98%) rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryClientTest.java (98%) rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDaemonTest.java (99%) rename server/sonar-telemetry/src/test/java/org/sonar/telemetry/{deprecated => legacy}/TelemetryDataJsonWriterTest.java (99%) rename server/sonar-telemetry/src/test/resources/org/sonar/telemetry/{deprecated => legacy}/dummy.crt (100%) rename server/sonar-webserver/src/test/java/org/sonar/server/{ => platform}/telemetry/TelemetryVersionProviderTest.java (91%) diff --git a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/QualityProfileDataProviderIT.java b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java similarity index 99% rename from server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/QualityProfileDataProviderIT.java rename to server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java index 3da1cf0ca83..f521c3cf7d4 100644 --- a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/QualityProfileDataProviderIT.java +++ b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import javax.annotation.Nullable; import org.assertj.core.api.Assertions; diff --git a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImplIT.java b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java similarity index 98% rename from server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImplIT.java rename to server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java index 4f47a549ee9..4fa82ad1b97 100644 --- a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImplIT.java +++ b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import com.tngtech.java.junit.dataprovider.DataProvider; import com.tngtech.java.junit.dataprovider.DataProviderRunner; @@ -67,10 +67,10 @@ import org.sonar.server.property.MapInternalProperties; import org.sonar.server.qualitygate.QualityGateCaycChecker; import org.sonar.server.qualitygate.QualityGateFinder; import org.sonar.server.qualityprofile.QProfileComparison; -import org.sonar.telemetry.deprecated.TelemetryData.Branch; -import org.sonar.telemetry.deprecated.TelemetryData.CloudUsage; -import org.sonar.telemetry.deprecated.TelemetryData.NewCodeDefinition; -import org.sonar.telemetry.deprecated.TelemetryData.ProjectStatistics; +import org.sonar.telemetry.legacy.TelemetryData.Branch; +import org.sonar.telemetry.legacy.TelemetryData.CloudUsage; +import org.sonar.telemetry.legacy.TelemetryData.NewCodeDefinition; +import org.sonar.telemetry.legacy.TelemetryData.ProjectStatistics; import org.sonar.updatecenter.common.Version; import static java.util.Arrays.asList; @@ -101,7 +101,7 @@ import static org.sonar.db.component.BranchType.BRANCH; import static org.sonar.server.metric.UnanalyzedLanguageMetrics.UNANALYZED_CPP_KEY; import static org.sonar.server.metric.UnanalyzedLanguageMetrics.UNANALYZED_C_KEY; import static org.sonar.server.qualitygate.QualityGateCaycStatus.NON_COMPLIANT; -import static org.sonar.telemetry.deprecated.TelemetryDataLoaderImpl.EXTERNAL_SECURITY_REPORT_EXPORTED_AT; +import static org.sonar.telemetry.legacy.TelemetryDataLoaderImpl.EXTERNAL_SECURITY_REPORT_EXPORTED_AT; @RunWith(DataProviderRunner.class) public class TelemetryDataLoaderImplIT { diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Dimension.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java similarity index 97% rename from server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Dimension.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java index db9654398bd..d301b49e14b 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Dimension.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.telemetry; +package org.sonar.telemetry; /** * Represents the dimension of the data provided by a {@link TelemetryDataProvider}. diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Granularity.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java similarity index 97% rename from server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Granularity.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java index b44d6391c6b..c342ef2f285 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/Granularity.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.telemetry; +package org.sonar.telemetry; /** * Represent the granularity of the data provided by a {@link TelemetryDataProvider}. This both defines the time period between to pushes to diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataProvider.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java similarity index 94% rename from server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataProvider.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java index 8dc200306af..fb0f7f8ebef 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataProvider.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.telemetry; +package org.sonar.telemetry; import java.util.Map; @@ -27,8 +27,8 @@ import java.util.Map; * If you want to add new metric to the telemetry system, you need to create a new implementation of this interface and register it in the * Spring context as a bean. * - * @param type of the value provided by this instance. Should be either {@link java.lang.Boolean}, {@link java.lang.String}, - * {@link java.lang.Integer} or {@link java.lang.Float}. + * @param type of the value provided by this instance. Should be either {@link Boolean}, {@link String}, + * {@link Integer} or {@link Float}. */ public interface TelemetryDataProvider { diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataType.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java similarity index 96% rename from server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataType.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java index 923e9894416..99ddd8c3768 100644 --- a/server/sonar-server-common/src/main/java/org/sonar/server/telemetry/TelemetryDataType.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.telemetry; +package org.sonar.telemetry; /** * Represents the type of the data provided by a {@link TelemetryDataProvider}. diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/CloudUsageDataProvider.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/CloudUsageDataProvider.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java index ac4c6cda698..ad69cb0f2dd 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/CloudUsageDataProvider.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import com.google.common.annotations.VisibleForTesting; import com.google.gson.Gson; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/QualityProfileDataProvider.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/QualityProfileDataProvider.java similarity index 98% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/QualityProfileDataProvider.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/QualityProfileDataProvider.java index fd0747529e3..7c111323a1f 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/QualityProfileDataProvider.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/QualityProfileDataProvider.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.util.List; import java.util.Map; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryClient.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryClient.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryClient.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryClient.java index 20d792aff4b..7b4b85a9da0 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryClient.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryClient.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.io.IOException; import okhttp3.Call; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDaemon.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDaemon.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDaemon.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDaemon.java index a65a1d9ccd9..8868744eb53 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDaemon.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDaemon.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.io.IOException; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryData.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryData.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java index 28c270fb3c9..188df1427ca 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryData.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.util.Arrays; import java.util.Collection; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriter.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriter.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java index d2cb6cd231c..486a47e1d65 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriter.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import com.google.common.annotations.VisibleForTesting; import java.time.Instant; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoader.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoader.java similarity index 95% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoader.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoader.java index 658c2deccee..6dff9b0958a 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoader.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoader.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; public interface TelemetryDataLoader { TelemetryData load(); diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImpl.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java similarity index 99% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImpl.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java index 183d7f3eca0..65432e4048e 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImpl.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.sql.DatabaseMetaData; import java.sql.SQLException; @@ -65,8 +65,8 @@ import org.sonar.server.property.InternalProperties; import org.sonar.server.qualitygate.Condition; import org.sonar.server.qualitygate.QualityGateCaycChecker; import org.sonar.server.qualitygate.QualityGateFinder; -import org.sonar.telemetry.deprecated.TelemetryData.Database; -import org.sonar.telemetry.deprecated.TelemetryData.NewCodeDefinition; +import org.sonar.telemetry.legacy.TelemetryData.Database; +import org.sonar.telemetry.legacy.TelemetryData.NewCodeDefinition; import static java.util.Arrays.asList; import static java.util.Optional.ofNullable; @@ -89,7 +89,7 @@ import static org.sonar.db.newcodeperiod.NewCodePeriodType.REFERENCE_BRANCH; import static org.sonar.server.metric.UnanalyzedLanguageMetrics.UNANALYZED_CPP_KEY; import static org.sonar.server.metric.UnanalyzedLanguageMetrics.UNANALYZED_C_KEY; import static org.sonar.server.qualitygate.Condition.Operator.fromDbValue; -import static org.sonar.telemetry.deprecated.TelemetryDaemon.I_PROP_MESSAGE_SEQUENCE; +import static org.sonar.telemetry.legacy.TelemetryDaemon.I_PROP_MESSAGE_SEQUENCE; @ServerSide public class TelemetryDataLoaderImpl implements TelemetryDataLoader { diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/package-info.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/package-info.java similarity index 95% rename from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/package-info.java rename to server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/package-info.java index 6e334e48264..6e4734d9b13 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/package-info.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/package-info.java @@ -18,6 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ @ParametersAreNonnullByDefault -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/package-info.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/package-info.java new file mode 100644 index 00000000000..26a5da46bbe --- /dev/null +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/package-info.java @@ -0,0 +1,23 @@ +/* + * SonarQube + * Copyright (C) 2009-2024 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +@ParametersAreNonnullByDefault +package org.sonar.telemetry; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/CloudUsageDataProviderTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/CloudUsageDataProviderTest.java similarity index 95% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/CloudUsageDataProviderTest.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/CloudUsageDataProviderTest.java index ef7b9f0cde3..dc14c8725ad 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/CloudUsageDataProviderTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/CloudUsageDataProviderTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -44,10 +44,10 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import static org.sonar.telemetry.deprecated.CloudUsageDataProvider.DOCKER_RUNNING; -import static org.sonar.telemetry.deprecated.CloudUsageDataProvider.KUBERNETES_SERVICE_HOST; -import static org.sonar.telemetry.deprecated.CloudUsageDataProvider.KUBERNETES_SERVICE_PORT; -import static org.sonar.telemetry.deprecated.CloudUsageDataProvider.SONAR_HELM_CHART_VERSION; +import static org.sonar.telemetry.legacy.CloudUsageDataProvider.DOCKER_RUNNING; +import static org.sonar.telemetry.legacy.CloudUsageDataProvider.KUBERNETES_SERVICE_HOST; +import static org.sonar.telemetry.legacy.CloudUsageDataProvider.KUBERNETES_SERVICE_PORT; +import static org.sonar.telemetry.legacy.CloudUsageDataProvider.SONAR_HELM_CHART_VERSION; public class CloudUsageDataProviderTest { diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/FakeServer.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/FakeServer.java similarity index 97% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/FakeServer.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/FakeServer.java index 2aba4bd50b2..2e2060834f4 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/FakeServer.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/FakeServer.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.util.Date; import org.sonar.api.platform.Server; diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientCompressionTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientCompressionTest.java similarity index 98% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientCompressionTest.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientCompressionTest.java index 2e06214a36f..a9343df8303 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientCompressionTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientCompressionTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.io.IOException; import java.util.Objects; diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientTest.java similarity index 98% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientTest.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientTest.java index c0adfc11629..a2bf58cdc91 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.io.IOException; import okhttp3.MediaType; diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDaemonTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDaemonTest.java similarity index 99% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDaemonTest.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDaemonTest.java index 56a3ac858f8..62d9e397feb 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDaemonTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDaemonTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import java.io.IOException; import java.util.Collections; diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriterTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java similarity index 99% rename from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriterTest.java rename to server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java index 1041f2787b5..4534fa3ec17 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriterTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.telemetry.deprecated; +package org.sonar.telemetry.legacy; import com.tngtech.java.junit.dataprovider.DataProvider; import com.tngtech.java.junit.dataprovider.DataProviderRunner; diff --git a/server/sonar-telemetry/src/test/resources/org/sonar/telemetry/deprecated/dummy.crt b/server/sonar-telemetry/src/test/resources/org/sonar/telemetry/legacy/dummy.crt similarity index 100% rename from server/sonar-telemetry/src/test/resources/org/sonar/telemetry/deprecated/dummy.crt rename to server/sonar-telemetry/src/test/resources/org/sonar/telemetry/legacy/dummy.crt diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java index 44b54cd1ad1..c37fa753d5e 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/platformlevel/PlatformLevel4.java @@ -282,12 +282,12 @@ import org.sonar.server.webhook.WebhookQGChangeEventListener; import org.sonar.server.webhook.ws.WebhooksWsModule; import org.sonar.server.ws.WebServiceEngine; import org.sonar.server.ws.ws.WebServicesWsModule; -import org.sonar.telemetry.deprecated.CloudUsageDataProvider; -import org.sonar.telemetry.deprecated.QualityProfileDataProvider; -import org.sonar.telemetry.deprecated.TelemetryClient; -import org.sonar.telemetry.deprecated.TelemetryDaemon; -import org.sonar.telemetry.deprecated.TelemetryDataJsonWriter; -import org.sonar.telemetry.deprecated.TelemetryDataLoaderImpl; +import org.sonar.telemetry.legacy.CloudUsageDataProvider; +import org.sonar.telemetry.legacy.QualityProfileDataProvider; +import org.sonar.telemetry.legacy.TelemetryClient; +import org.sonar.telemetry.legacy.TelemetryDaemon; +import org.sonar.telemetry.legacy.TelemetryDataJsonWriter; +import org.sonar.telemetry.legacy.TelemetryDataLoaderImpl; import static org.sonar.core.extension.CoreExtensionsInstaller.noAdditionalSideFilter; import static org.sonar.core.extension.PlatformLevelPredicates.hasPlatformLevel4OrNone; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/TelemetryVersionProvider.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/TelemetryVersionProvider.java index 12b0f40c17a..d76962b7cea 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/TelemetryVersionProvider.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/telemetry/TelemetryVersionProvider.java @@ -20,10 +20,10 @@ package org.sonar.server.platform.telemetry; import org.sonar.api.platform.Server; -import org.sonar.server.telemetry.Dimension; -import org.sonar.server.telemetry.Granularity; -import org.sonar.server.telemetry.TelemetryDataProvider; -import org.sonar.server.telemetry.TelemetryDataType; +import org.sonar.telemetry.Dimension; +import org.sonar.telemetry.Granularity; +import org.sonar.telemetry.TelemetryDataProvider; +import org.sonar.telemetry.TelemetryDataType; public class TelemetryVersionProvider implements TelemetryDataProvider { diff --git a/server/sonar-webserver/src/test/java/org/sonar/server/telemetry/TelemetryVersionProviderTest.java b/server/sonar-webserver/src/test/java/org/sonar/server/platform/telemetry/TelemetryVersionProviderTest.java similarity index 91% rename from server/sonar-webserver/src/test/java/org/sonar/server/telemetry/TelemetryVersionProviderTest.java rename to server/sonar-webserver/src/test/java/org/sonar/server/platform/telemetry/TelemetryVersionProviderTest.java index 4335f71f9a6..d5ea987eb6d 100644 --- a/server/sonar-webserver/src/test/java/org/sonar/server/telemetry/TelemetryVersionProviderTest.java +++ b/server/sonar-webserver/src/test/java/org/sonar/server/platform/telemetry/TelemetryVersionProviderTest.java @@ -17,11 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package org.sonar.server.telemetry; +package org.sonar.server.platform.telemetry; import org.junit.jupiter.api.Test; import org.sonar.api.platform.Server; -import org.sonar.server.platform.telemetry.TelemetryVersionProvider; +import org.sonar.telemetry.Dimension; +import org.sonar.telemetry.Granularity; +import org.sonar.telemetry.TelemetryDataType; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -- 2.39.5