diff options
author | Alain Kermis <alain.kermis@sonarsource.com> | 2024-07-09 16:16:42 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-07-24 20:02:47 +0000 |
commit | 8d858dd3b7c87e5a39d8031d527a723d5191ba53 (patch) | |
tree | 17a3f81c1e4eb3e8727a3c3eb682a7d07088493a /server/sonar-telemetry/src | |
parent | 0bd5289a0f535e88aba1b83fb18053671b50f8b8 (diff) | |
download | sonarqube-8d858dd3b7c87e5a39d8031d527a723d5191ba53.tar.gz sonarqube-8d858dd3b7c87e5a39d8031d527a723d5191ba53.zip |
SONAR-22479 Refactored new telemetry model
Diffstat (limited to 'server/sonar-telemetry/src')
-rw-r--r-- | server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/QualityProfileDataProviderIT.java (renamed from server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/QualityProfileDataProviderIT.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java (renamed from server/sonar-telemetry/src/it/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImplIT.java) | 12 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java | 29 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java | 29 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java | 78 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java | 28 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/CloudUsageDataProvider.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/QualityProfileDataProvider.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/QualityProfileDataProvider.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryClient.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryClient.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDaemon.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDaemon.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryData.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriter.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoader.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoader.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImpl.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/TelemetryDataLoaderImpl.java) | 8 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/package-info.java (renamed from server/sonar-telemetry/src/main/java/org/sonar/telemetry/deprecated/package-info.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/main/java/org/sonar/telemetry/package-info.java | 23 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/CloudUsageDataProviderTest.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/CloudUsageDataProviderTest.java) | 10 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/FakeServer.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/FakeServer.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientCompressionTest.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientCompressionTest.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryClientTest.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryClientTest.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDaemonTest.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDaemonTest.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java (renamed from server/sonar-telemetry/src/test/java/org/sonar/telemetry/deprecated/TelemetryDataJsonWriterTest.java) | 2 | ||||
-rw-r--r-- | server/sonar-telemetry/src/test/resources/org/sonar/telemetry/legacy/dummy.crt (renamed from server/sonar-telemetry/src/test/resources/org/sonar/telemetry/deprecated/dummy.crt) | 0 |
23 files changed, 216 insertions, 29 deletions
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 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 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-telemetry/src/main/java/org/sonar/telemetry/Dimension.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java new file mode 100644 index 00000000000..d301b49e14b --- /dev/null +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Dimension.java @@ -0,0 +1,29 @@ +/* + * 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. + */ +package org.sonar.telemetry; + +/** + * Represents the dimension of the data provided by a {@link TelemetryDataProvider}. + * {@link Dimension#PROJECT}, {@link Dimension#LANGUAGE} and {@link Dimension#USER} should not provide aggregated data. + * For aggregated data (i.e. average number of lines of code per project), use #INSTALLATION. + */ +public enum Dimension { + INSTALLATION, PROJECT, USER, LANGUAGE +} diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java new file mode 100644 index 00000000000..c342ef2f285 --- /dev/null +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/Granularity.java @@ -0,0 +1,29 @@ +/* + * 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. + */ +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 + * telemetry server for a given metric and the time period that the data represents. + * Modifying this enum needs to be discussed beforehand with Data Platform team. + */ +public enum Granularity { + DAILY, WEEKLY, MONTHLY; +} diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java new file mode 100644 index 00000000000..fb0f7f8ebef --- /dev/null +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataProvider.java @@ -0,0 +1,78 @@ +/* + * 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. + */ +package org.sonar.telemetry; + +import java.util.Map; + +/** + * This interface is used to provide data to the telemetry system. The telemetry system will call the methods of this interface to get the + * data that will be sent to the telemetry server. + * 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 <T> type of the value provided by this instance. Should be either {@link Boolean}, {@link String}, + * {@link Integer} or {@link Float}. + */ +public interface TelemetryDataProvider<T> { + + /** + * @return the key of the metric that will be used to store the value of the data provided by this instance. The combination of + * metric key and dimension needs to be universally unique. The metric key needs to be written in snake_case. + */ + String getMetricKey(); + + /** + * @return the dimension ("category") of the data provided by this instance. The combination of metric key and dimension needs to be + * universally unique. + */ + Dimension getDimension(); + + /** + * @return returns the granularity of this telemetry metric. + * @see Granularity + */ + Granularity getGranularity(); + + /** + * @return the type of the data provided by this instance. + */ + TelemetryDataType getType(); + + /** + * The implementation of this method might often need to make a call to a database. + * For each metric either this method or {@link TelemetryDataProvider#getUuidValues()} should be implemented and used. Not both at once. + * + * @return the value of the data provided by this instance. + */ + default T getValue() { + throw new IllegalStateException("Not implemented"); + } + + /** + * The implementation of this method might often need to make a call to a database. + * Similiar as {@link TelemetryDataProvider#getValue()} this method returns values of the metric. Some of the metrics + * associate a UUID with a value. This method is used to return all the values associated with the UUIDs. + * + * @return map of UUIDs and their values. + */ + default Map<String, T> getUuidValues() { + throw new IllegalStateException("Not implemented"); + } +} diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java new file mode 100644 index 00000000000..99ddd8c3768 --- /dev/null +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/TelemetryDataType.java @@ -0,0 +1,28 @@ +/* + * 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. + */ +package org.sonar.telemetry; + +/** + * Represents the type of the data provided by a {@link TelemetryDataProvider}. + * Modifying this enum needs to be discussed beforehand with Data Platform team. + */ +public enum TelemetryDataType { + BOOLEAN, STRING, INTEGER, FLOAT +} 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 index 10e8a4a760e..10e8a4a760e 100644 --- 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 |