1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

hotfix: Don't write SonarQube coverage metrics to InfluxDB (#3347)

This commit is contained in:
Marc Bormeth 2021-12-10 09:13:25 +01:00 committed by GitHub
parent e6c5c8a72f
commit 61d1358ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 16 deletions

View File

@ -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{

View File

@ -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"}}},
},
},
},

View File

@ -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