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

chore(sonar): assign error categories to know error cases (#2111)

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
Christopher Fenner 2020-10-02 15:08:08 +02:00 committed by GitHub
parent b2b4278b34
commit 9341ae4934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,6 @@
package cmd
import (
"github.com/bmatcuk/doublestar"
"io/ioutil"
"os"
"os/exec"
@ -19,6 +18,7 @@ import (
StepResults "github.com/SAP/jenkins-library/pkg/piperutils"
SonarUtils "github.com/SAP/jenkins-library/pkg/sonar"
"github.com/SAP/jenkins-library/pkg/telemetry"
"github.com/bmatcuk/doublestar"
"github.com/pkg/errors"
)
@ -59,8 +59,16 @@ const (
func sonarExecuteScan(config sonarExecuteScanOptions, _ *telemetry.CustomData, influx *sonarExecuteScanInflux) {
runner := command.Command{
ErrorCategoryMapping: map[string][]string{
"infrastructure": {
log.ErrorConfiguration.String(): {
"org.sonar.java.AnalysisException: Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.",
"ERROR: Invalid value for *",
"java.lang.IllegalStateException: No files nor directories matching '*'",
},
log.ErrorInfrastructure.String(): {
"ERROR: SonarQube server [*] can not be reached",
"Caused by: java.net.SocketTimeoutException: timeout",
"java.lang.IllegalStateException: Fail to request *",
"java.lang.IllegalStateException: Fail to download plugin [*] into *",
},
},
}