From 61d1358ca5535465042ae25965c4ee95a88860d6 Mon Sep 17 00:00:00 2001 From: Marc Bormeth Date: Fri, 10 Dec 2021 09:13:25 +0100 Subject: [PATCH] hotfix: Don't write SonarQube coverage metrics to InfluxDB (#3347) --- cmd/sonarExecuteScan.go | 3 --- cmd/sonarExecuteScan_generated.go | 8 +------- resources/metadata/sonarExecuteScan.yaml | 6 ------ 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/cmd/sonarExecuteScan.go b/cmd/sonarExecuteScan.go index 54e47ab54..99e362916 100644 --- a/cmd/sonarExecuteScan.go +++ b/cmd/sonarExecuteScan.go @@ -237,9 +237,6 @@ func runSonar(config sonarExecuteScanOptions, client piperhttp.Downloader, runne if err != nil { return err // No wrap, description already added one level below } - influx.sonarqube_data.fields.coverage = cov.Coverage - influx.sonarqube_data.fields.branch_coverage = cov.BranchCoverage - influx.sonarqube_data.fields.line_coverage = cov.LineCoverage log.Entry().Debugf("Influx values: %v", influx.sonarqube_data.fields) err = SonarUtils.WriteReport(SonarUtils.ReportData{ diff --git a/cmd/sonarExecuteScan_generated.go b/cmd/sonarExecuteScan_generated.go index 95cb4b533..b6c6a40ae 100644 --- a/cmd/sonarExecuteScan_generated.go +++ b/cmd/sonarExecuteScan_generated.go @@ -62,9 +62,6 @@ type sonarExecuteScanInflux struct { major_issues int minor_issues int info_issues int - coverage float32 - branch_coverage float32 - line_coverage float32 } tags struct { } @@ -84,9 +81,6 @@ func (i *sonarExecuteScanInflux) persist(path, resourceName string) { {valType: config.InfluxField, measurement: "sonarqube_data", name: "major_issues", value: i.sonarqube_data.fields.major_issues}, {valType: config.InfluxField, measurement: "sonarqube_data", name: "minor_issues", value: i.sonarqube_data.fields.minor_issues}, {valType: config.InfluxField, measurement: "sonarqube_data", name: "info_issues", value: i.sonarqube_data.fields.info_issues}, - {valType: config.InfluxField, measurement: "sonarqube_data", name: "coverage", value: i.sonarqube_data.fields.coverage}, - {valType: config.InfluxField, measurement: "sonarqube_data", name: "branch_coverage", value: i.sonarqube_data.fields.branch_coverage}, - {valType: config.InfluxField, measurement: "sonarqube_data", name: "line_coverage", value: i.sonarqube_data.fields.line_coverage}, } errCount := 0 @@ -532,7 +526,7 @@ func sonarExecuteScanMetadata() config.StepData { Type: "influx", Parameters: []map[string]interface{}{ {"Name": "step_data"}, {"fields": []map[string]string{{"name": "sonar"}}}, - {"Name": "sonarqube_data"}, {"fields": []map[string]string{{"name": "blocker_issues"}, {"name": "critical_issues"}, {"name": "major_issues"}, {"name": "minor_issues"}, {"name": "info_issues"}, {"name": "coverage"}, {"name": "branch_coverage"}, {"name": "line_coverage"}}}, + {"Name": "sonarqube_data"}, {"fields": []map[string]string{{"name": "blocker_issues"}, {"name": "critical_issues"}, {"name": "major_issues"}, {"name": "minor_issues"}, {"name": "info_issues"}}}, }, }, }, diff --git a/resources/metadata/sonarExecuteScan.yaml b/resources/metadata/sonarExecuteScan.yaml index be085fe17..280f4f30b 100644 --- a/resources/metadata/sonarExecuteScan.yaml +++ b/resources/metadata/sonarExecuteScan.yaml @@ -288,12 +288,6 @@ spec: type: int - name: info_issues type: int - - name: coverage - type: float32 - - name: branch_coverage - type: float32 - - name: line_coverage - type: float32 containers: - name: sonar image: sonarsource/sonar-scanner-cli:4.6