Pull request decoraton in bitbucket datacenter

Sonarqube version - 8.4.2
Scanner - 4.0.0.1744
Plugin - Sonar for Bitbucket Server

We are trying to decorate analysis of soanr report(with branch analysis) on btbucket UI and its only showing for master.

for branch we are getting a response " 404 116 “-” “Apache-HttpClient/4.5.10 (Java/1.8.0_265)”

With sonar for bitbucket plugin when request is hitting to sonarqube side with master branch, it is forming below URL:

"GET /api/measures/component?additionalFields=periods,metrics&metricKeys=duplicated_lines_density,new_duplicated_lines_density,new_violations,new_major_violations,new_critical_violations,new_blocker_violations,violations,major_violations,critical_violations,blocker_violations,new_vulnerabilities,vulnerabilities,new_bugs,bugs,new_code_smells,code_smells,sqale_rating,new_maintainability_rating,reliability_rating,new_reliability_rating,security_rating,new_security_rating,coverage,new_coverage,ncloc,new_lines,new_sqale_debt_ratio,sqale_debt_ratio,sqale_index&component=<PROJECT_KEY>

This is showing us teh result at bitbucket perfectly.

With sonar for bitbucket plugin when request is hitting to sonarqube side with any other branch other than ‘master’, it is forming below URL:

"GET /api/measures/component?additionalFields=periods,metrics&metricKeys=duplicated_lines_density,new_duplicated_lines_density,new_violations,new_major_violations,new_critical_violations,new_blocker_violations,violations,major_violations,critical_violations,blocker_violations,new_vulnerabilities,vulnerabilities,new_bugs,bugs,new_code_smells,code_smells,sqale_rating,new_maintainability_rating,reliability_rating,new_reliability_rating,security_rating,new_security_rating,coverage,new_coverage,ncloc,new_lines,new_sqale_debt_ratio,sqale_debt_ratio,sqale_index&component=<PROJECT_KEY>%3A<BRANCH_NAME>

and this is not showing any report at bitbucket side. On checking further at Sonarqube (access.log) , its giving “HTTP 404” response.

We think this behaviour is because somehow in requested API URL “component=<PROJECT_KEY>%3A<BRANCH_NAME>” in the URL is appending branch name using “:”(%3A), however, Sonarqube is entertaining the request if we are itting it with “component=<PROJECT_KEY>&branch=<BRANCH_NAME>”. For default branch (“master” in our case), as it doesn’t append any branch, so report is evaluating fine.

Please help

Hi @saiteja,

Are you using the Mibex plugin? If so, we do not support 3rd party plugins, so you’ll need request support from them. See here: https://marketplace.atlassian.com/apps/1212735/sonar-for-bitbucket-server?hosting=server&tab=support

Joe