Template for a good bug report, formatted with Markdown:
versions used (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube 8.2-developer, sonar-maven-plugin 3.6.0.1398
error observed (wrap logs/code around triple quote ``` for proper formatting)
Warnings:
Could not find ref 'master' in refs/heads or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
Property 'sonar.jacoco.reportPath' is no longer supported. Use JaCoCo's xml report and sonar-jacoco plugin.
Pull request decoration did not happen. Commit 'c3f9d26eda76c51edf61b311172a91c3dde671a4' not found in pull request '144'
So why am I getting the other complaint?
More seriously, the REAL issue is this:
Pull request decoration did not happen. Commit 'c3f9d26eda76c51edf61b311172a91c3dde671a4' not found in pull request '144'
Because this is the exact commit SHA and CHANGE_ID provided by the trigger for the build. I have seen this in other builds. My developers are complaining about this problem and need answers.
I re-ran the project through SonarQube 8.3.1-DE and got the same results. Maven was invoked with this command: mvn -B -e '-Dsonar.userHome=/home/gradle' '-Dsonar.host.url=https://sonarqube.example.com' '-Dsonar.scm.disabled=true' '-Dsonar.pullrequest.branch=1.7-release' '-Dsonar.pullrequest.base=master' '-Dsonar.pullrequest.key=144' sonar:sonar and resulting analysis produced an error link to this:
Additional error messages appeared following the last analysis:
Could not find ref 'master' in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
Pull request decoration did not happen. Commit 'bcf092a5304cd0a75de68c2aab2556f4c8b387ff' not found in pull request '144'
Creating an analysis summary for GitHub Pull Request has failed. Please check the permission configuration and the connectivity to GitHub.
I’ve been able to understand this now; I have confirmed the workspace contains a .git directory populated from the pull-request commit. But it ONLY contains the PR branch code, labeled PR-<pull #> so I need to revise how Jenkins does the “Discover PR from origin” from “The current pull-request branch” to “Merging the pull-request with the target branch revision” and make sure my setting for “sonar.pullrequest.key=PR-${CHANGE_ID}”