We have pull requests getting blocked by SonarQube. The analysis includes issues that are not distinct from the base branch.
The comments to GitHub are correct (a single issue introduced by the PR), but SonarQube posts a failed commit check with 33 open issues. When I visit SonarQube the header says
for merge into master from PR-1234 and the issues include 32 issues introduced by Staging relative to master, not just the single issue the PR introduced.
Jenkins is running sonar-scanner with the following arguments:
-Dsonar.projectKey=example -Dsonar.projectName=Example/example -Dsonar.pullrequest.branch=PR-1234 -Dsonar.pullrequest.key=1234 -Dsonar.pullrequest.base=Staging -Dsonar.pullrequest.provider=github -Dsonar.pullrequest.github.repository=Example/example -Dsonar.pullrequest.github.endpoint=https://github.example.com/api/v3/
How do I get the PR analysis to correctly analyze these PRs relative to their base branch and not master?