Automate the Pull Request Decoration in BitBucket

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

  1. We have generated a personal access token with admin credentials in BitBucket.
  2. We configured this personal access token and bitbucket URL in SonarQube >> Administration >> ALM Integrations
  3. 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
  4. Then the system is showing the two options to analyze the repo i) With Jenkin ii) Manually
  5. 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
  6. Project Settings >> General Settings >> Pull Request Decoration >> configured the Configuration name, Project Key and Repository SLUG
  7. 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.

A post was merged into an existing topic: SonarQube integration with BitBucket for PR analysis and decorate PR in BitBucket it self