Failed to create Bitbucket Server Quality Report for commit SHA

Hi,
My configs:
SonarQube Developer Edition V8.2
Atlassian Bitbucket Server V 6.10.0

I am able to Analyze the PR with decoration, howver I’m getting warnings as: Failed to create Bitbucket Server Quality Report for commit SHA ‘xxxxxx’.

Below is the ce.log with TRACE level:

2020.07.14 07:32:48 DEBUG ce[AXNMBoA-_Fj5MY4cU5iF][c.s.C.D.A.D] Commit that triggered PR analysis: ‘xxxxx’
2020.07.14 07:32:48 DEBUG ce[AXNMBoA-_Fj5MY4cU5iF][c.s.C.D.A.A.C] Unable to contact Bitbucket server: 404 com.atlassian.bitbucket.commit.NoSuchCommitException Commit ‘xxxxx’ does not exist in repository ‘oraclecommerce’.

The above referenced commit has doesn’t exists anywhere in the repository. Is it having any issues with connecting the Bitbucket? Or any setting in the Sonar?

I have integrated the BitBucket Server in the ALM Integration settings with BitBucket URL and Personal Access Token. (Also I have a doubt with which ‘user’ sonar will try to connect Bitbucket - I haven’t mentioned anywhere in the configs)

My Ultimate aim is to block the PR merging when it fails the QG - I have referenced: https://docs.sonarqube.org/8.2/analysis/pr-decoration/ and below block:

Blocking Pull Request merges

*Blocking Pull Request merges is available starting with version 6.9 of Bitbucket Server

After setting up Pull Request analysis, you can block Pull Requests from being merged if they don’t meet your quality standards (if the Quality Gate is failing). To do this:

  1. From Bitbucket Server, navigate to Repository settings > Code Insights .
  2. Add a Required report called com.sonarsource.sonarqube , select Must pass as the Required status, and Must not have any annotations as the Annotation requirements.

Any help in achieving will be much appreciated. Thanks in Advance - Ariv

Hi,

You should double check exactly what happens in your pipeline & make sure it’s not doing a local-only commit. I believe sometimes that happens in order to build what the code will be after merge.

 
HTH,
Ann

1 Like

Hi Ann,

Yes Thanks for the info - I was using the ‘Discover Pull Request’ strategy in jenkins as ‘Merging the pull request with the current target branch revision’ which had a local merge commit is not recognized by sonar scanner. After change the strategy to ‘The current pull request revision’ everything works fine.

Thanks again!

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.