Versions of Tools:
SonarQube >> Enterprise Edition & 8.4.1.35646 version
Sonar Scanner >> 4.4.0.2170
BitBucket >> 6.6.2
Target
I’m trying to automate the Pull Request Decoration
Configurations did So Far
- We have generated a personal access token with admin credentials in BitBucket.
- We configured this personal access token and bitbucket URL in SonarQube >> Administration >> ALM Integrations
- Clicked on + Icon at right side top to add a project then clicked on bitbucket >> System displayed all the repositories available in the bit bucket
So I selected one of the repo and clicked on set up a selected repository - Then the system is showing the two options to analyze the repo i) With Jenkin ii) Manually
- I selected manually and followed the process to analyze the branch with the following commands
C:{scannerpath}\sonar-scanner 4.4.0.2170\bin\sonar-scanner
-Dsonar.projectKey=projectKey
-Dsonar.branch.name=branchname
-Dsonar.projectName=projectName
-Dsonar.host.url=hosturl
-Dsonar.login=loginkey - Project Settings >> General Settings >> Pull Request Decoration >> configured the Configuration name, Project Key and Repository SLUG
- Created a PR in bit bucket and ran the following command
C:{scannerpath}\sonar-scanner 4.4.0.2170\bin\sonar-scanner
-Dsonar.projectKey=projectKey
-Dsonar.projectName=projectName
-Dsonar.host.url=hostURL
-Dsonar.login=login
-Dsonar.password=password
-Dsonar.pullrequest.branch=feature/v8.13.4
-Dsonar.pullrequest.base=master
-Dsonar.pullrequest.key=285
-Dsonar.pullrequest.bitbucket.repository=giturl
-Dsonar.pullrequest.bitbucket.owner=bitbucketusername
I’m doing the analysis manually as above
Please suggest to me how we can achieve the automating the PR analysis and PR decoration.