Unable to get pullrequest decoration on Bitbucket Server

Hello,

I’m running the following

SonarQube Entreprise 8.3.1.34397
SonarScanner 4.3.0.2102-linux
Bitbucket Server v6.10.0

I try to get the pull request decoration on Bitbucket Server.
I configure the ALM Integration on my Sonarqube Server. Then I set “Project Key” and “Repository SLUG” on a project.

I run a pull request analysis successfully (i can see the Pull request analysis and the link “See the PR” at the top right of the page), but i cant see pull request decoration in Bibucket.

I see in Sonarqube compute engine logs:
2020.06.01 09:06:35 INFO ce[xxxxxx][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=511ms

The only related access logs i can see in Bitbucket is a WARN:
2020-06-01 09:06:35,787 WARN "DELETE /rest/insights/1.0/projects/xxxx/repos/xxxx/commits/xxxx/reports/com.sonarsource.sonarqube/annotations HTTP/1.0" c.a.p.r.c.s.j.XsrfResourceFilter XSRF failure not being enforced for request: https://xxx.xxx.xxx/rest/insights/1.0/projects/xxx/repos/xxx/commits/xxxx/reports/com.sonarsource.sonarqube/annotations , origin: null , referrer: null, method: DELETE

Is this WARN in bitbucket the root cause of the missing decoration ?
I can’t find any other message in Sonarqube logs, How can i get the PR Decoration ?

Thanks for you help
François

The Sonarsource team helped me to find the configuration bug on my side.

By setting the the log level to DEBUG on the compute engine, I was able to see the following message:

2020.06.03 14:07:10 DEBUG ce[xxxxxx][c.s.C.D.A.D] Commit that triggered PR analysis: ‘’
2020.06.03 14:07:10 INFO ce[xxxxxx][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=403ms

This helped to understand that a bug in my CI pipeline set the current repository to the wrong branch. So the commit mentioned in the log was not part of the pull request.

Fixing this, made the pull decoration work as expected.

I suggest to change the log level from DEBUG to INFO for the message that mentioned the commit.

1 Like

Welcome to SonarSource community forum @francoissamin
And thanks for sharing!

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