File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,14 +44,20 @@ def run_pylint(){
4444
4545def get_sonarqube_unresolved_issues (report_task_file ){
4646 script{
47-
48- def props = readProperties file : ' .scannerwork/report-task.txt'
49- def response = httpRequest url : props[' serverUrl' ] + " /api/issues/search?componentKeys=" + props[' projectKey' ] + " &resolved=no"
47+ if (! fileExists(report_task_file)){
48+ error " Could not find ${ report_task_file} "
49+ }
50+ def props = readProperties file : report_task_file
51+ if (! props[' serverUrl' ] || ! props[' projectKey' ]){
52+ error " Could not find serverUrl or projectKey in ${ report_task_file} "
53+ }
54+ def response = httpRequest url : props[' serverUrl' ] + ' /api/issues/search?componentKeys=' + props[' projectKey' ] + ' &resolved=no'
5055 def outstandingIssues = readJSON text : response. content
5156 return outstandingIssues
5257 }
5358}
5459
60+
5561def installMSVCRuntime (cacheLocation ){
5662 def cachedFile = " ${ cacheLocation} \\ vc_redist.x64.exe" . replaceAll(/ \\\\ +/ , ' \\\\ ' )
5763 withEnv(
@@ -413,8 +419,7 @@ def call(){
413419 unstable " SonarQube quality gate: ${ sonarqube_result.status} "
414420 }
415421 if (env. BRANCH_IS_PRIMARY ){
416- def outstandingIssues = get_sonarqube_unresolved_issues(' .scannerwork/report-task.txt' )
417- writeJSON file : ' reports/sonar-report.json' , json : outstandingIssues
422+ writeJSON(file : ' reports/sonar-report.json' , json : get_sonarqube_unresolved_issues(' .sonar/report-task.txt' ))
418423 recordIssues(tools : [sonarQube(pattern : ' reports/sonar-report.json' )])
419424 }
420425 }
You can’t perform that action at this time.
0 commit comments