aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlukasz-jarocki-sonarsource <lukasz.jarocki@sonarsource.com>2024-10-22 16:31:08 +0200
committersonartech <sonartech@sonarsource.com>2024-10-23 20:02:47 +0000
commitdff3bfa1c6ff73aaf5314935ce90e1a98474d60f (patch)
treea1bb4cf92c672def850cca275c595955fa42e753
parentd9f6920331a0f274f1d6227c2af74d6dbfe84aa2 (diff)
downloadsonarqube-dff3bfa1c6ff73aaf5314935ce90e1a98474d60f.tar.gz
sonarqube-dff3bfa1c6ff73aaf5314935ce90e1a98474d60f.zip
SONAR-23461 fixed an issue where telemetry for helm autoscaling and openshift was not sent
-rw-r--r--server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java2
-rw-r--r--server/sonar-telemetry/src/test/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriterTest.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java
index b186e15f059..37ab8e87f0e 100644
--- a/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java
+++ b/server/sonar-telemetry/src/main/java/org/sonar/telemetry/legacy/TelemetryDataJsonWriter.java
@@ -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());
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 1984cf4b041..fd4b3cbd684 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
@@ -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);
}