Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

SonarQube plugin for Bitbucket does not immediately show the SonarQube issues inline with the code a

SonarQube plugin for Bitbucket does not immediately show the SonarQube issues inline with the code after the scan for the pull request is completed and you have to manually force the plugin to get the issues displayed by selecting the "Refresh Sonar analysis" option in bitbucket.refresh_sonar_analysis (1).pngBB Vendor Plgin Issue.PNGrefresh_sonar_analysis (1).png

1 answer

Hi,

The app will automatically add issue information to your pull requests when it gets informed by SonarQube about new analysis results through webhooks.

If that doesn't happen, and you need to manually refresh it, then something with the webhook configuration is wrong.

Could you please check if you see a working webhook under SonarQube admin -> general -> webhooks?

Thanks,
Michael (app vendor)

Hey Michael Thanks for response. Can you tell me where do I need to check this thing   working webhook under SonarQube admin -> general -> webhooks?

In Sonarqube or in bitbucket do I need to check?

Hi Michael Can you reply for above query.

You're very welcome. In SonarQube.

Yes that i understood In Sonarqube i need to check but in "Administration" I need to go and then general and then webhooks or else you want to convey.

Hi Michael Yes I found the web hook configuration in sonarqube but wondering how to check whether it's working properly or not. Can you suggest this thing.

Thanks

Do you see an entry in the web hook list with an URL targeting your Bitbucket Server instance?

Is there a green tick under the column "Last delivery"?

BB Plugin Issue.PNGYes i see the Url but it's not green tick that means something wrong with webhook configuration. How can I correct this thing?

What error do you get? You see the error details by clicking on the right icon?

Getting this message

Response: Server Unreachable

Duration: 7ms

Payload:

{
"serverUrl": "http://sonarqube.sunlifecorp.com:9000",
"taskId": "AXRxuLlEE_lwDT5vH3oN",
"status": "SUCCESS",
"analysedAt": "2020-09-09T07:14:49+0000",
"revision": "976613025056c8e4c4105daf14ca2579c31fdbd4",
"changedAt": "2020-09-09T07:14:49+0000",
"project": {
"key": "ca.sunlife.ind.web:ind-web-policy-lumarketindex",
"name": "ca.sunlife.ind.web.ind-web-policy-lumarketindex",
"url": "http://sonarqube.sunlifecorp.com:9000/dashboard?id=ca.sunlife.ind.web%3Aind-web-policy-lumarketindex"
},
"branch": {
"name": "develop",
"type": "BRANCH",
"isMain": true,
"url": "http://sonarqube.sunlifecorp.com:9000/dashboard?id=ca.sunlife.ind.web%3Aind-web-policy-lumarketindex"
},
"qualityGate": {
"name": "SLF Quality Gate - 90%",
"status": "ERROR",
"conditions": [
{
"metric": "new_security_rating",
"operator": "GREATER_THAN",
"value": "1",
"status": "OK",
"errorThreshold": "1"
},
{
"metric": "new_coverage",
"operator": "LESS_THAN",
"value": "88.53159433325838",
"status": "ERROR",
"errorThreshold": "90"
},
{
"metric": "new_blocker_violations",
"operator": "GREATER_THAN",
"value": "0",
"status": "OK",
"errorThreshold": "0"
},
{
"metric": "new_vulnerabilities",
"operator": "GREATER_THAN",
"value": "0",
"status": "OK",
"errorThreshold": "0"
}
]
},
"properties": {}
}

Regarding " Server Unreachable": Is it possible that due to network/firewall settings, SonarQube cannot access Bitbucket Server?

Hey Michael Thanks for replying.

But I am not sure about this thing that when server is Unreachable what need to do. That's why I raised a question here just to get the solution of the behavior  of this particular "Sonar for bit bucket" plugin. Why it's not working. 

As from atlassian community they already told this thing that this plugin is a third-party supported for which vendor Is "Mibex". So they told that you need to check with the vendor of Mibex team for this issue.

And I think If I am not mistaken then Michael you are from "Mibex Team" who is looking into this issue.

So, Please suggest the ways to tackle the problem. I have already send you the error message completely and screenshots as well so that you will better understand them.

You're very welcome. The web hook configuration looks OK. But SonarQube could not reach Bitbucket Server when executing the web hook. That could have various (internal network) reasons. I would suggest that you try to ping Bitbucket from SonarQube to see if your network configuration allows it. Please let me know if this helps.

Okay But Michael how can i ping from Sonarqube Server.

As the reports generation and code analysis process is going on from bitbucket to sonarqube. Our Users are doing this thing with no issues. I think if this task is work then possibly the server is reachable from sonarqube to bitbucket.

Or is there any other way if you suggest so that I can check this point?

And one more thing I wanted to confirm from you that I was reading "Sonar for bit bucket server plugin" document and found that editions mentioned are only 2(community and commercial edition) What it means Is this plugin will not be applicable/working in Bit bucket if we have "Enterprise Edition Of Sonarqube running".(See attachment for this).

So, FYI currently we are using Sonarqube version 8.2 of Enterprise Edition.

I am reading this document from below link:-

https://mibexsoftware.atlassian.net/wiki/spaces/MSS/pages/162398304/How+to+setup+Sonar+for+Bitbucket

Sonar for BB Plugin Issue Docs.PNG

I would get into contact with your network team to see if a connection between SonarQube -> Bitbucket is possible.

Commercial editions means both "Developer" and "Enterprise" edition. So that will work.

Hope that helps. Otherwise, please let me know.

Okay Thanks Michael for confirmation.

Please keep me updated regarding the network team connect.

Also Michael I thing i found something missing in my bitbucket server in repository settings(See attachments).

Sonar Plugin New branch feature missing.PNGBut when I am reading this document from below link:-

https://mibexsoftware.atlassian.net/wiki/spaces/SONAR4STASH/pages/197165057/Migrating+to+the+new+Sonar+6.7+LTS+branch+plug-in

Then here, a different option is coming in step no.-8Mibex Plugin Sonar Doc.PNG of above link which is "use new branching feature" option is coming in above link but in my bitbucket server in repo settings this option is not coming.(see attachments).

 

May be this is something we need to check.

Would it be possible for you to create a support ticket at https://support.mibexsoftware.com ? That will help us to better support you so that we can exchange log files etc.

Please reference this community article when you submit a support request. Thanks!

Hey Michael I have created the support request over the above link.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍂📹 Apptoberfest demo contest roundup: vote for your favorite demos!

Hi Community! The submissions are in (and listed below) for the 🍻🍂Apptoberfest🍂🍻 Demo Competition and it’s time for you to place your votes for the best: Analytics & reporting app demo ...

278 views 7 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you