Pull request decoration did not happen for BitbucketCloud

I am seeing this warning in my PR-page on SonarCloud.

Pull request decoration did not happen. Please install SonarCloud application on the Bitbucket repository’s organization or user.

It worked fine till 11-th January, this problem has been started from 14 January.

The main problem: SonarCloud doesn’t publish results to BitbucketCloud PR (commit).

I mean next(second result):

I tried to reinstall application ‘SonarCloud’ on Bitbucket Cloud, but it does not help.

Hi,
Is the repository that you are targeting with your PR registered to your user or to one of your teams?

Hi, thanks for the response

Repository registered to one of my teams.

Do you have the SonarCloud app installed for your team or only for your user? If the repository is assigned to the team the app has to be installed in that team settings.

Yes, it’s installed in the team.

I seem to have the same problem on only a few of our projects.

PR on 11th shows the decoration and PR on the 14th does not. I also can’t see any more PR analysis inside sonar cloud, so the analysis is not happening at all.

Any updates ?

Hey,
Due to the GDPR changes in BitbucketCloud API, SonarCloud no longer supports using owner and repository slugs in:

  • sonar.pullrequest.bitbucketcloud.owner

  • sonar.pullrequest.bitbucketcloud.repository

You have to supply UUIDs in these two parameters. We forgot to update the SonarCloud docs, apologies for that, we will correct it soon. For Bitbucket Pipelines these two parameters are not needed at all since these will be autodetected. For Jenkins you can fetch the owner and repository UUID using something like https://github.com/jenkinsci/bitbucket-plugin.

I tried to use UUID but it does not help.

Are you using exactly the same format of the UUID that is returned by Bitbucket (so with curly brackets like for example this "{00836e58-dc79-4a8d-bc69-6f2003b95087}")? If yes and it still doesn’t work please send me the UUID in a private message or email.

Hi Michal,

Thank you very much for help UUID partly fixed the issue on SonarCloud PR screen.

I mean so the SonarCloud still not publishes commit result to status build on BitBucket (like on the first screenshot), but BitBucket PR-link is accessible from SonarCloud.

Do you have any idea about this issue?

Hi,
After fixing the UUID, do you get any warnings in SonarCloud after the analysis? Can you send me the logs of the full analysis (privately)?

No, after fixing the UUID warnings are gone. I mean SonarCloud not publish results to Bitbucket Builds (like on the screenshot in this issue)

Hi Olexandr,
This is a problem on SonarCloud side. It will be resolved after the next SonarCloud deployment- I’ll make a post once it’s done.

Thanks for reporting this and all the help!

The fix has been deployed. Can you recheck if everything is fine for your pull requests?

hi @Michal_Duda I’m experiencing a similar problem. I managed to get our integration working with Bitbucket and I can see the Widget in the PR. However no decoration or comments on it. I have set the UUID for the owner and repository and the additional parameters

Any idea what to try next? Our repos are private. Can this be the issue?

Hello David,
It doesn’t matter if the repository is private or not. Can you please post the analysis log (you can anonymize information that you don’t want to share)? Do you see any warnings on the project dashboard, like the one here:

I see one warning although I have master in Sonarcloud

Could not find ref ‘master’ in refs/heads or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.

I’m attaching the log of the analysis. Any ideas what is wrong with the config?

[INFO] SonarQube version: 8.0.0
[INFO] Default locale: “en_US”, source code encoding: “UTF-8”
[INFO] Load global settings
[INFO] Load global settings (done) | time=170ms
[INFO] Server id: BD367519-AWHW8ct9-T_TB3XqouNu
[INFO] User cache: /home/ubuntu/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=62ms
[INFO] Load/download plugins (done) | time=215ms
[INFO] Loaded core extensions: developer-scanner
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=4ms
[INFO] Project key: company_service
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud
[INFO] Working dir: /data/workspace/uct-service_new-test-sonar-cloud/target/sonar
[INFO] Load project settings for component key: ‘company_service’
[INFO] Load project settings for component key: ‘company_service’ (done) | time=40ms
[INFO] Load project branches
[INFO] Load project branches (done) | time=17ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=13ms
[INFO] Load branch configuration
[INFO] Load branch configuration (done) | time=10ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=54ms
[INFO] Detected Jenkins
[INFO] Load active rules
[INFO] Load active rules (done) | time=782ms
[INFO] Organization key: company
[INFO] Pull request 23 for merge into master from new-test-sonar-cloud
[INFO] SCM collecting changed files in the branch
[WARNING] Could not find ref: master in refs/heads or refs/remotes/origin
[INFO] SCM collecting changed files in the branch (done) | time=63ms
[INFO] Indexing files…
[INFO] Project configuration:
[INFO] Indexing files of module ‘module-domain’
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud/module-domain
[INFO] Source paths: pom.xml, src/main/java
[INFO] Indexing files of module ‘module-persistence’
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud/module-persistence
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Indexing files of module ‘module-rest’
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud/module-rest
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Indexing files of module ‘service-client’
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud/service-client
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Indexing files of module ‘service’
[INFO] Base dir: /data/workspace/uct-service_new-test-sonar-cloud
[INFO] Source paths: pom.xml
[INFO] 118 files indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for java: Sonar way
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module module-domain
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=15ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=12ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=1ms
[INFO] Java Main Files AST scan
[INFO] 33 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=31ms
[INFO] 33/33 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=1887ms
[INFO] Java Test Files AST scan
[INFO] 0 source files to be analyzed
[INFO] Java Test Files AST scan (done) | time=1ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=2456ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/data/workspace/uct-service_new-test-sonar-cloud/module-domain/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=1ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=0ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 0/0 source files have been analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=142ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=15ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=122ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
[INFO] ------------- Run sensors on module module-persistence
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=1ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=1ms
[INFO] Java Main Files AST scan
[INFO] 18 source files to be analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] 18/18 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=1513ms
[INFO] Java Test Files AST scan
[INFO] 5 source files to be analyzed
[INFO] 5/5 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Test Files AST scan (done) | time=291ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=1820ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/data/workspace/uct-service_new-test-sonar-cloud/module-persistence/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=2ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=32ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=1ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=17ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
[INFO] ------------- Run sensors on module service-client
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=3ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=1ms
[INFO] Java Main Files AST scan
[INFO] 17 source files to be analyzed
[INFO] 17/17 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=562ms
[INFO] Java Test Files AST scan
[INFO] 4 source files to be analyzed
[INFO] 4/4 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Test Files AST scan (done) | time=183ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=765ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/data/workspace/uct-service_new-test-sonar-cloud/service-client/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=1ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=21ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=0ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=17ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
[INFO] ------------- Run sensors on module module-rest
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=3ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=1ms
[INFO] Java Main Files AST scan
[INFO] 30 source files to be analyzed
[INFO] 30/30 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=1117ms
[INFO] Java Test Files AST scan
[INFO] 6 source files to be analyzed
[INFO] 6/6 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Test Files AST scan (done) | time=262ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=1407ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/data/workspace/uct-service_new-test-sonar-cloud/module-rest/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=0ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=21ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=0ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=9ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
[INFO] ------------- Run sensors on module service
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=14ms
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=0ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=9ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=0ms
[INFO] Sensor JavaSecuritySensor [security]
[INFO] Reading type hierarchy from: /data/workspace/uct-service_new-test-sonar-cloud/target/sonar/ucfg2/java
[INFO] 1/1 source files have been analyzed
[INFO] Read 224 type definitions
[INFO] Reading UCFGs from: /data/workspace/uct-service_new-test-sonar-cloud/target/sonar/ucfg2/java
[INFO] 06:21:00.664 Building Type propagation graph
[INFO] 06:21:00.69 Running Tarjan on 1243 nodes
[INFO] 06:21:00.695 Tarjan found 1243 components
[INFO] 06:21:00.708 Variable type analysis: done
[INFO] 06:21:00.71 Building Type propagation graph
[INFO] 06:21:00.725 Running Tarjan on 1243 nodes
[INFO] 06:21:00.726 Tarjan found 1243 components
[INFO] 06:21:00.729 Variable type analysis: done
[INFO] Analyzing 243 ucfgs to detect vulnerabilities.
[INFO] All rules entrypoints : 0 Retained UCFGs : 0
[INFO] rule: S5131, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5131 done
[INFO] rule: S3649, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S3649 done
[INFO] rule: S2076, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S2076 done
[INFO] rule: S2091, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S2091 done
[INFO] rule: S2078, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S2078 done
[INFO] rule: S2631, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S2631 done
[INFO] rule: S5135, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5135 done
[INFO] rule: S2083, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S2083 done
[INFO] rule: S5167, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5167 done
[INFO] rule: S5144, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5144 done
[INFO] rule: S5145, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5145 done
[INFO] rule: S5146, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5146 done
[INFO] rule: S5334, entrypoints: 0
[INFO] Visited 0 ucfgs in 0 ms, 0 steps
[INFO] rule: S5334 done
[INFO] Sensor JavaSecuritySensor [security] (done) | time=657ms
[INFO] Sensor CSharpSecuritySensor [security]
[INFO] Reading type hierarchy from: /data/workspace/uct-service_new-test-sonar-cloud/target/ucfg_cs2
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /data/workspace/uct-service_new-test-sonar-cloud/target/ucfg_cs2
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor CSharpSecuritySensor [security] (done) | time=1ms
[INFO] Sensor PhpSecuritySensor [security]
[INFO] Reading type hierarchy from: /data/workspace/uct-service_new-test-sonar-cloud/target/sonar/ucfg2/php
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /data/workspace/uct-service_new-test-sonar-cloud/target/sonar/ucfg2/php
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor PhpSecuritySensor [security] (done) | time=0ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=20ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=92ms
[INFO] SCM provider for this project is: git
[INFO] 24 files to be analyzed
[INFO] 24/24 files analyzed
[INFO] 36 files had no CPD blocks
[INFO] Calculating CPD for 62 files
[INFO] CPD calculation finished
[INFO] SCM writing changed lines
[WARNING] Could not find ref: master in refs/heads or refs/remotes/origin
[INFO] SCM writing changed lines (done) | time=3ms
[INFO] Analysis report generated in 96ms, dir size=342 KB
[INFO] Analysis report compressed in 104ms, zip size=168 KB
[INFO] Analysis report uploaded in 36ms
[INFO] ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/dashboard?id=company_service&pullRequest=23
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at https://sonarcloud.io/api/ce/task?id=AWwI5BfUzU3INxZBqWMK
[INFO] Analysis total time: 14.038 s

I managed to remove the warning since there was a problem with the config for fetching. Still no decoration.

hi @Michal_Duda any ideas on what to try next? I still cannot get the decoration working and I don’t have any more warnings