Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR decoration for bitbucket fails in latest 1.5 release #265

Closed
tobilarscheid opened this issue Nov 2, 2020 · 3 comments · Fixed by #284
Closed

PR decoration for bitbucket fails in latest 1.5 release #265

tobilarscheid opened this issue Nov 2, 2020 · 3 comments · Fixed by #284

Comments

@tobilarscheid
Copy link

tobilarscheid commented Nov 2, 2020

@mc1arke @ksl67 @marvin-w unfortunately since #237 PR decoration fails with the following stracktrace for me:

sonarqube    | com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.client.BitbucketException: The field 'message' is required
sonarqube    | 	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.client.BitbucketServerClient.validate(BitbucketServerClient.java:189)
sonarqube    | 	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.client.BitbucketServerClient.uploadAnnotations(BitbucketServerClient.java:114)
sonarqube    | 	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.BitbucketPullRequestDecorator.updateAnnotations(BitbucketPullRequestDecorator.java:153)
sonarqube    | 	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.bitbucket.BitbucketPullRequestDecorator.decorateQualityGateStatus(BitbucketPullRequestDecorator.java:98)
sonarqube    | 	at com.github.mc1arke.sonarqube.plugin.ce.pullrequest.PullRequestPostAnalysisTask.finished(PullRequestPostAnalysisTask.java:160)

The Code Insights API expects the field to be called message: https://docs.atlassian.com/bitbucket-server/rest/7.7.0/bitbucket-code-insights-rest.html#idp12

Maybe an additional field for summary is needed?

Originally posted by @tobilarscheid in #237 (comment)

@ababilone
Copy link

Hi there,

FYI, I've encountered the same issue with plugin 1.6, sonar 8.5.1 and bitbucket server 6.8.0.

@mKeRix
Copy link
Contributor

mKeRix commented Dec 7, 2020

I uploaded a snapshot release of 1.6.0 with the added fix for Bitbucket Server code annotations over in our fork, if you need this before it is merged: https://github.com/idealo/sonarqube-community-branch-plugin/releases/tag/1.6.1-SNAPSHOT

@ivayloc
Copy link

ivayloc commented Jan 16, 2021

I am using SonarQube 8.5.0 Community with plugin version 1.6 and I am trying to run Pull request decoration in BitBucket Cloud, but they just wont to appear, these are my setting:

sonar-project.properties

sonar.host.url=[SONARQUBE_HOST]
sonar.login=[SONARQUBE_TOKEN]
sonar.projectKey=test-app
sonar.projectName=My Test App
sonar.branch.name=dev
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.tests=src
sonar.exclusions=**/node_modules/**
sonar.test.inclusions=**/*.spec.ts

bitbucket-pipelines.yml

image: node:10.15.0
pipelines:
  pull-requests:
    "**": 
      - step:
          name: SonarQube Analysis
          image: sonarsource/sonar-scanner-cli
          script:
            - sonar-scanner -X
              -Dsonar.projectBaseDir=$(pwd)
              -Dproject.settings=sonar-project.properties
              -Dsonar.login=$SONAR_LOGIN
              -Dsonar.pullrequest.key=$BITBUCKET_PR_ID
              -Dsonar.pullrequest.branch=$BITBUCKET_BRANCH
              -Dsonar.pullrequest.base=$BITBUCKET_PR_DESTINATION_BRANCH

Also in my Project Settings->General Settings->Pull Request Decoration there is this message:

This feature must first be enabled in the global settings.

but I can't find such setting in global settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants