]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-23461 fixed an issue where telemetry for helm autoscaling and openshift was...
authorlukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com>
Tue, 22 Oct 2024 14:31:08 +0000 (16:31 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 23 Oct 2024 20:02:47 +0000 (20:02 +0000)
server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java
server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java

index b186e15f05983014d485d0eec5a227b0bd5b5d7e..37ab8e87f0e7ff2327b172e038e1c2886a6c879e 100644 (file)
@@ -278,6 +278,8 @@ public class TelemetryDataJsonWriter {
     json.prop("kubernetesVersion", cloudUsage.kubernetesVersion());
     json.prop("kubernetesPlatform", cloudUsage.kubernetesPlatform());
     json.prop("kubernetesProvider", cloudUsage.kubernetesProvider());
+    json.prop("isHelmAutoscalingEnabled", cloudUsage.isHelmAutoscalingEnabled());
+    json.prop("isOnOpenshift", cloudUsage.isOnOpenshift());
     json.prop("officialHelmChart", cloudUsage.officialHelmChart());
     json.prop("containerRuntime", cloudUsage.containerRuntime());
     json.prop("officialImage", cloudUsage.officialImage());
index 1984cf4b0412aba64488f1d3c45b012ada50d73c..fd4b3cbd684569cac8648bf818df980ab021ee6a 100644 (file)
@@ -298,13 +298,15 @@ class TelemetryDataJsonWriterTest {
     TelemetryData data = telemetryBuilder().build();
 
     String json = writeTelemetryData(data);
-    assertJson(json).isSimilarTo("""
+    assertJson(json).withStrictArrayOrder().isSimilarTo("""
       {
         "cloudUsage": {
           "kubernetes": true,
           "kubernetesVersion": "1.27",
           "kubernetesPlatform": "linux/amd64",
           "kubernetesProvider": "5.4.181-99.354.amzn2.x86_64",
+          "isHelmAutoscalingEnabled": true,
+          "isOnOpenshift": false,
           "officialHelmChart": "10.1.0",
           "officialImage": false,
           "containerRuntime": "docker"
@@ -701,7 +703,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", false, false, "docker", false))
+      .setCloudUsage(new TelemetryData.CloudUsage(true, "1.27", "linux/amd64", "5.4.181-99.354.amzn2.x86_64", "10.1.0", false, true, "docker", false))
       .setDatabase(new TelemetryData.Database("H2", "11"))
       .setNcdId(NCD_ID);
   }