List of code analysis of all pull request analysis is not showing up in Sonarcloud dropdown

We have used Jenkins ‘Bitbucket pull request builder’ parameter to trigger a build and scan Sonar analysis for every pull request in Bitbucket cloud, it worked out very well and we can able to fetch the results every pull request code analysis in the Sonarcloud as Shown below :

But, whenever a new pull request is created, the code analysis of the old pull requests and its stats are automatically been replaced by the news ones and as a result we can able to check the stats of only one pull request (Recent one)

The parameters which we have mentioned in SonarQube scanner are:

sonar.host.url,
sonar.organization,
sonar.projectName,
sonar.projectVersion,
sonar.projectKey,
sonar.pullrequest.branch ( Gave it’s value as $GIT_BRANCH),
sonar.sources, sonar.java.binaries,
sonar.exclusions
,sonar.pullrequest.key
,sonar.pullrequest.provider

Please let us know how can we view all the analysis of the previous pull requests in the drop down box near the master branch in Sonarcloud GUI?

Thank you,

Since the value of GIT_BRANCH is changing for every pull request, the result of the PR which was published to Sonarcloud is also getting replaced. In order to provide difference between every build in Jenkins, we have added the build number in Sonar.pullrequest.key ( sonar.pullrequest.key= $BUILD_NUMBER) and we could able to fetch all the results of the PR in Sonarcloud

1 Like