I have a Pipeline script with two steps.
SonarQube
analysisUnitTests
If the SonarQube
finds warnings, it reports them back to Gerrit as comments and set the Code-review-1
. The next stage is the UnitTest and if it is OK the Pipeline will be successful and the Jenkins should report back to Gerrit Verified+1
. BUT, when Jenkins reports the Verified+1
then it removes the Code-review-1
.
Related part of my Pipeline script:
....
steps {
withSonarQubeEnv('Managed SonarQube') {
sh '''./sonar_runner.sh preview'''
sonarToGerrit(
inspectionConfig: [
serverURL: env.'SONAR_HOST_URL',
baseConfig: [
sonarReportPath: '.scannerwork/sonar-report.json',
autoMatch: true
]
],
scoreConfig: [
issueFilterConfig: [
severity: 'MINOR',
newIssuesOnly: false,
changedLinesOnly: false
],
category: 'Code-Review',
noIssuesScore: 0,
issuesScore: -1
]
)
}
stage('UnitTest') {
steps {
ansiColor('xterm') {
sh '''./unittest.sh'''
}
....
My "Gerrit Reporting Values" section:
My Gerrit history:
My final result:
My question:
How can I set the the Code-review-1
and Verified+1
in one running? How can I avoid that Gerrit removes the Code-review-1
when reports Verified+1
? I am open to GUI solution as well as Pipeline.
EDIT:
It is not option to change the global config of Gerrit plugin. I have to solve it on Jenkins job level. Is it possible?