UPDATE! This appears to be the following issue: Failed to create Bitbucket Server Quality Report - HTTP 400 - annotations required
We are seeing 400 errors with bitbucket complaining about the annotations (I was finally able to get those logs). We are going to try updating to sonar 7.8 and see if that resolves it, and will report back here with results.
Thank you @ganncamp, I will look out for it once it is available!
@Julien_HENRY, for now, I am at a total loss to get this last issue resolved so we can get consistent PR decoration. Here is the current state of our affairs, if there is something obvious I am missing that you can see that will resolve this, you will be my hero!
BitBucket Server version: 5.16.3
SonarQube version: 7.7
PR Commit ID: 18c4358c…
PR Number: 75
PR Branch: PR-75 (this comes from the Jenkins BitBucket integration, since BitBucket server creates ephemeral branches when PRs are submitted).
Actual Branch that PR comes from: begoldsm/my-feature
Jenkins File Snippet for PR:
if (env.CHANGE_ID) {
withCredentials(...) {
status = sh returnStatus: true,
script: '''#!/bin/bash
git fetch $repoUrl +refs/heads/$CHANGE_TARGET:refs/remotes/origin/$CHANGE_TARGET
# also tried with git reset --soft refs/remotes/origin/$BRANCH_NAME when using the merge to target strategy in jenkins
./gradlew check sonarqube --info \
-Dsonar.host.url=$SONAR_HOST \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.pullrequest.branch=$BRANCH_NAME \ # Also tried the feature branch name
-Dsonar.pullrequest.key=$CHANGE_ID \
-Dsonar.pullrequest.bitbucketserver.headSha=18c4358c... # I explicitly hard coded it for the run to see if that works.
'''
}
}
This results in the following:
- All iterations result in the “error” warning (shown below), however the first run does create the
SonarQube
insights cog in the PR overview (which I can click on and get information about). - All subsequent commits or runs through sonar do not update that insights cog and they all end up with the following warning from sonar:
Failed to create Bitbucket Server Quality Report for commit SHA '18c4358c...'
Note that I am quite happy that we resolved the other warning with the git fetch
, which is great! Now we just need to figure out why we are still getting this quality report warning.