PR comment is not appeared in Bitbucket cloud

Versions.
sonarQube : Developer Edition 9.7.1.62043

  • internal network in company, internet connected, but can not receive webhook from outside.

Jenkins with multibranch pipeline: 2.361.4

  • internal network in company, internet connected, but can not receive webhook from outside.

Bitbucket Cloud

Behavior.

  1. In sonarQube, test for PRs are done like this.
    image

  2. PR in bitbucket, sonarQube test report is recived and builds are also passed.
    image

  3. PR in bitbucket, there is no comments and inline comment.

  4. In jenkins, multibranch pipeline is configured. and it is pipeline script for scanner.

withSonarQubeEnv() {
sh """
	export SONAR_SCANNER_OPTS='-Xmx50G'
	
	${scannerHome}/bin/sonar-scanner \
	-Dsonar.projectName=[Name] \
	-Dsonar.projectKey=[Name] \
	-Dsonar.issuesReport.console.enable=true \
	-Dsonar.sourceEncoding=UTF-8 \
	-Dsonar.host.url=[Address] \
	-Dsonar.sources=src \
	-Dsonar.pullrequest.key=${env.CHANGE_ID} \
	-Dsonar.pullrequest.base=${env.CHANGE_TARGET} \
	-Dsonar.pullrequest.branch=${env.CHANGE_BRANCH} \
	-Dsonar.login=[tocken_from_sonarqube] \
	-Dsonar.bitbucket.accountName=[ID_bitbucket]
"""
}

Question
Is there any addtional setting to make comment and inline comment at PR of bitbucket by sonarQube??

Hi,

You’ve said “Bitbucket Cloud” in the title of this thread. Since your other systems are self-managed, I want to confirm that that one’s actually the cloud service?

In global Administration → DevOps Platform Integrations, when you Check configuration does it come back as green / well configured?

And can you check your ce.log server log to see if it says anything?

 
Ann

Thank you for your reply.

  1. configuration
    There is screenshot.

  2. log
    I checked that log and there is no error.

2022.11.21 01:13:41 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | status=SUCCESS | time=0ms
2022.11.21 01:13:41 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2022.11.21 01:13:41 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | status=SUCCESS | time=0ms
2022.11.21 01:13:41 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=1 | projectWebhooks=0 | status=SUCCESS | time=95ms
2022.11.21 01:13:45 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=4202ms
2022.11.21 01:13:45 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Report branch Quality Gate status to devops platforms | status=SUCCESS | time=0ms
2022.11.21 01:13:45 INFO  ce[AYSXv3ItWeFZXwOhd0aK][o.s.c.t.CeWorkerImpl] Executed task | project=EMS_BranchTest | type=REPORT | pullRequest=68 | id=AYSXv3ItWeFZXwOhd0aK | submitter=admin

Hi,

Thanks for checking. I’ve flagged this for more expert eyes.

 
Ann

Hi @Yuuuuuns ,

I’m a little confused: what do you expect to see in Bitbucket? In your example, the Quality Gate is passed, so I don’t expect to see anything specific on your PR. Furthermore, we don’t do inline comments on Bitbucket; we submit what Bitbucket calls a “report”, and this report contains the details. But, if there’s nothing in the report (everything green), well, then you will only see “Quality Gate passed”.

Dear Wouter Admiraal,

I found the screeshot like this before purchasing sonarQube.
It looks great, however, it is not operated yet.
example from Sonarqube + Bitbucket Cloud + Pull request decoration - SonarQube - Sonar Community (sonarsource.com)
image

In case of fails, the inline comment is not appeared.

SonarQube report was generated, and report says, the line of that file have problem.
HPP file line:41

image

Hi again,

Sorry for the late reply. I’ve referred this internally to get an extra pair of eyes looking at this. I’ll get back to you ASAP.

Hi again,

OK, can you please check your sonar.core.serverBaseURL setting (in conf/sonar.properties)? Changing it will require restarting SonarQube. If this setting is not correct, Bitbucket Cloud will not be able to communicate back to SonarQube, and pushing a report with annotations will fail.

(for reference, similar issue)

Hello again!

sonar.core.serverBaseURL was set to company internal IP. At outside, we can not access this IP, because it is in internal network in company as I mentioned.

In company network, I can access this IP and use sonarQube properly.

Can you change it to an IP or hostname that Bitbucket Cloud can access (don’t forget to restart)? For pull request decoration to work, Bitbucket Cloud needs to check the request is legit, and to do this, it contacts the SonarQube server. If it cannot reach SonarQube, the pull request decoration cannot happen.

I understood the limitation of sonarQube. I believed that PR decorations can works well because I thought that data for decorations sent from local sonarQube to Bitbucket by one way.