diff options
author | lukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com> | 2024-09-23 09:11:01 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-09-23 20:02:40 +0000 |
commit | 96492f2bf93e4ed65ebc5dff19fb973af94289b3 (patch) | |
tree | 95cb8d8405eaae3ba60a9273cfa53d074839163a /server/sonar-telemetry/src | |
parent | d5450363bddc9a66114cb8675484f38032a2fc4a (diff) | |
download | sonarqube-96492f2bf93e4ed65ebc5dff19fb973af94289b3.tar.gz sonarqube-96492f2bf93e4ed65ebc5dff19fb973af94289b3.zip |
SONAR-22997 added telemetry for openshift
Diffstat (limited to 'server/sonar-telemetry/src')
4 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java index 631e8a27197..65f434b29a5 100644 --- a/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java +++ b/server/sonar-telemetry/src/it/java/org/sonar/telemetry/legacy/TelemetryDataLoaderImplIT.java @@ -691,7 +691,7 @@ public class TelemetryDataLoaderImplIT { @Test public void load_shouldContainCloudUsage() { - CloudUsage cloudUsage = new CloudUsage(true, "1.27", "linux/amd64", "5.4.181-99.354.amzn2.x86_64", "10.1.0", "docker", false); + CloudUsage cloudUsage = new CloudUsage(true, "1.27", "linux/amd64", "5.4.181-99.354.amzn2.x86_64", "10.1.0", false, "docker", false); when(cloudUsageDataProvider.getCloudUsage()).thenReturn(cloudUsage); TelemetryData data = commercialUnderTest.load(); @@ -700,7 +700,7 @@ public class TelemetryDataLoaderImplIT { @Test public void default_quality_gate_sent_with_project() { - db.components().insertPublicProject().getMainBranchComponent(); + db.components().insertPublicProject(); QualityGateDto qualityGate = db.qualityGates().insertQualityGate(qg -> qg.setName("anything").setBuiltIn(true)); db.qualityGates().setDefaultQualityGate(qualityGate); TelemetryData data = communityUnderTest.load(); diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java index ad69cb0f2dd..28229274208 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/CloudUsageDataProvider.java @@ -115,6 +115,7 @@ public class CloudUsageDataProvider { kubernetesPlatform, getKubernetesProvider(), getOfficialHelmChartVersion(), + containerSupport.isRunningOnHelmOpenshift(), containerSupport.getContainerContext(), isOfficialImageUsed()); diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java index fdd4f70223a..59a9c6d95a6 100644 --- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java +++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryData.java @@ -386,7 +386,7 @@ public class TelemetryData { record CloudUsage(boolean kubernetes, @Nullable String kubernetesVersion, @Nullable String kubernetesPlatform, @Nullable String kubernetesProvider, - @Nullable String officialHelmChart, @Nullable String containerRuntime, boolean officialImage) { + @Nullable String officialHelmChart, boolean isOnOpenshift, @Nullable String containerRuntime, boolean officialImage) { } public static class ProjectStatistics { diff --git a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java index 2592a7fedb3..48ec921ad5a 100644 --- a/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java +++ b/server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java @@ -696,7 +696,7 @@ class TelemetryDataJsonWriterTest { .setMessageSequenceNumber(1L) .setPlugins(Collections.emptyMap()) .setManagedInstanceInformation(new TelemetryData.ManagedInstanceInformation(false, null)) - .setCloudUsage(new TelemetryData.CloudUsage(true, "1.27", "linux/amd64", "5.4.181-99.354.amzn2.x86_64", "10.1.0", "docker", false)) + .setCloudUsage(new TelemetryData.CloudUsage(true, "1.27", "linux/amd64", "5.4.181-99.354.amzn2.x86_64", "10.1.0", false, "docker", false)) .setDatabase(new TelemetryData.Database("H2", "11")) .setNcdId(NCD_ID); } |