diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2021-03-01 17:48:43 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-03-04 20:12:49 +0000 |
commit | 4c007c151c20a92ed5d76ce5ac04bae53919586e (patch) | |
tree | 46ebcf58d5bc7949c513d54b9ebb1feae5df8f1c /server/sonar-ce-task-projectanalysis | |
parent | 4558e5786f367160a219fd8bbc1f9872e51ea661 (diff) | |
download | sonarqube-4c007c151c20a92ed5d76ce5ac04bae53919586e.tar.gz sonarqube-4c007c151c20a92ed5d76ce5ac04bae53919586e.zip |
SONAR-14525 include CI usage information in telemetry
Diffstat (limited to 'server/sonar-ce-task-projectanalysis')
-rw-r--r-- | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStep.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStep.java index ec1055ff4b5..633f2ff9e01 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStep.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/PersistAnalysisPropertiesStep.java @@ -19,8 +19,10 @@ */ package org.sonar.ce.task.projectanalysis.step; +import com.google.common.collect.ImmutableSet; import java.util.ArrayList; import java.util.List; +import java.util.Set; import org.sonar.ce.task.projectanalysis.analysis.AnalysisMetadataHolder; import org.sonar.ce.task.projectanalysis.batch.BatchReportReader; import org.sonar.ce.task.step.ComputationStep; @@ -32,6 +34,7 @@ import org.sonar.db.component.AnalysisPropertyDto; import org.sonar.scanner.protocol.output.ScannerReport; import static org.sonar.core.config.CorePropertyDefinitions.SONAR_ANALYSIS; +import static org.sonar.core.config.CorePropertyDefinitions.SONAR_ANALYSIS_DETECTEDCI; import static org.sonar.core.config.CorePropertyDefinitions.SONAR_ANALYSIS_DETECTEDSCM; /** @@ -40,6 +43,7 @@ import static org.sonar.core.config.CorePropertyDefinitions.SONAR_ANALYSIS_DETEC public class PersistAnalysisPropertiesStep implements ComputationStep { private static final String SONAR_PULL_REQUEST = "sonar.pullrequest."; + private static final Set<String> ANALYSIS_PROPERTIES_TO_PERSIST = ImmutableSet.of(SONAR_ANALYSIS_DETECTEDSCM, SONAR_ANALYSIS_DETECTEDCI); private final DbClient dbClient; private final AnalysisMetadataHolder analysisMetadataHolder; @@ -61,7 +65,8 @@ public class PersistAnalysisPropertiesStep implements ComputationStep { it.forEachRemaining( contextProperty -> { String propertyKey = contextProperty.getKey(); - if (propertyKey.startsWith(SONAR_ANALYSIS) || propertyKey.startsWith(SONAR_PULL_REQUEST) || SONAR_ANALYSIS_DETECTEDSCM.equals(propertyKey)) { + if (propertyKey.startsWith(SONAR_ANALYSIS) || propertyKey.startsWith(SONAR_PULL_REQUEST) || + ANALYSIS_PROPERTIES_TO_PERSIST.contains(propertyKey)) { analysisPropertyDtos.add(new AnalysisPropertyDto() .setUuid(uuidFactory.create()) .setKey(propertyKey) |