I, I am pretty new to configuring Sonar Qube on a git repository. I am running the sonar scanner in the Jenkinsfile of my project. It works really well regarding my Pull Requests. I am able to see the results of the analysis in SonarQube as expected on the SonarQube Dashboard (web browser).
But for my master branch (main branch), I am unable to see the most recent analysis performed by Jenkins. I can see in the logs of Jenkins that the analysis Succeeded and was uploaded to SonarQube. But in Sonar Qube iself, it only shows the analysis from 2 years ago.
Here are the logs of the success (Jenkins logs) :
16:28:35.798 INFO: ANALYSIS SUCCESSFUL, you can find the results at: (I HID the link on purpose)
16:28:35.798 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
16:28:35.798 INFO: More about the report processing at (I HID the link because of confidential information)
16:28:35.801 DEBUG: Post-jobs :
16:28:35.820 INFO: Analysis total time: 33.658 s
16:28:35.821 INFO: ------------------------------------------------------------------------
16:28:35.821 INFO: EXECUTION SUCCESS
16:28:35.821 INFO: ------------------------------------------------------------------------
16:28:35.821 INFO: Total time: 43.533s
16:28:35.944 INFO: Final Memory: 61M/214M
16:28:35.944 INFO: ------------------------------------------------------------------------
I can see in the link about the “report processing” that it is taking the information of the failed analysis from 2 years ago… And not from the actual most recent code…
"errorMessage":"This analysis will make your organization (Hidden Organization name) to reach the maximum allowed lines limit (having 507811 lines).
Here is the Overview on SonarQube :
And an view of the “master” branch :
Here is the Jenkinsfile code regarding the Sonar Qube analysis :
stage('Analysis'){
parallel{
stage('Analysis-PR'){
when{ changeRequest()}
steps{
script{
withSonarQubeEnv('SonarCloud'){
sh ' /home/jenkins/.sonar/sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner' +
' -Dsonar.pullrequest.key=${CHANGE_ID}' +
' -Dsonar.pullrequest.branch=${BRANCH_NAME}' +
' -Dsonar.pullrequest.base=${CHANGE_TARGET}'
}
}
}
}
stage('Analysis-MasterBranch'){
when{
allOf{
branch 'master'
not { changeRequest() }
}
}
steps{
withSonarQubeEnv('SonarCloud'){
sh '/home/jenkins/.sonar/sonar-scanner-4.7.0.2747-linux/bin/sonar-scanner'
}
}
}
}
}
The same Jenkinsfile code worked well on another project that was started from scratch. Is it possible that it fails to update the Sonar Qube dashboard because of the previous analysis failure from 2 years ago? If so, is there a way to delete said analysis or branch completely from Sonar Qube to start anew?