Pull Request Scans Vs Branch Scans (Which strategy for Jenkins + Gitlab ?)

Hi Community,

my message is about 2 subjects but they are maybe related and they are maybe due to my misconception of Sonarqube.

  • Pull Request Scans and Branch Scans doesn’t display the same metrics.
  • How to integrate with Jenkins + Gitlab without the gitlab-branch-source-plugin ? which is not maintain anymore.

Context
Because :

  • of the maintenance issue with the plugin.
  • of the hard work to switch from our current workflow to this plugin for all our projects.
  • of a potential migration from jenkins to a new CI in the future. (tekton ?)

I tried to find a more agnostic solution and I’m evaluating the below jenkins pipeline. Currently, the pipeline is bootstraped only from Gitlab Push Event.

In the pipeline :
STEP1: Detection of a potential Merge Request for this source branch
STEP2a: If a MR is find, we launch the scanner with the pull request informations.
STEP2b: If a MR is not find, we launch the scanner with only the branch information.

Motivation
We switched to the developer version of sonarqube mainly to have the blocking quality gates for new code of features branches. And also to have the decoration of merge request.

Problem
Currently, the problem with this pipeline is that the metrics are not the same (Pull Request Scans vs Branch Scans). For example, i created a feature branch with new tests (this feature branch have an associated Merge request) and i cannot see the tests results at all, no coverage info neither…

What am I doing wrong ? Should i launch both scans when i detect a merge request ? Is it possible to plug directly sonarqube and gitlab (without jenkins) ?

I like the pull request scans because they are the smartest way and simplest way for detecting new code.

Thank you in advance.

François

Sonarqube 8.5
Gitlab 13.1.0
Jenkins 2.249.2

EDIT: The “New Code” have a Reference Branch configuration but this option cannot be dynamic for each scans. In our workflow, it will be very convenient, our feature branches can start from various stables branches. Is there some place where i can upvote for this feature (Dynamic Reference Branch) ?

-Dsonar.branch.name=feature-xyz -Dsonar.reference.branch.name=stable-abc

Hi Francois,

(Sorry about the missing accent. AmE keyboard. :flushed:)

The metrics calculated for PRs should be a subset of those available for branches. Specifically, you should get New Code metrics for PRs and New Code + Overall metrics for branches.

Let’s start with the basic coverage questions:

  • Did you run your tests and generate a coverage report? SonarQube won’t do either of those things for you.
  • Did you pass your coverage report in to analysis? Some analyzers might pick this up automatically, but not all do.
  • What, if anything, did your analysis log say about reading coverage reports?

:smiling_face_with_three_hearts:

 
Ann

Thx Ann for your time.

I’m using jacoco, it’s working fine with branch analysis, I have tests and coverage metrics in the report. But if I launch the maven scanner with PR informations instead of -Dsonar.branch.name= I lose these metrics. (Same Branch, Same scanner, Mostly same code)

Hi,

Wanna share the analysis logs, starting from the analysis command itself?

 
Ann

here the log of the scanner when using the PR arguments :

+ ./mvnw -B org.jacoco:jacoco-maven-plugin:0.8.5:report org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectVersion=56' '-Dsonar.pullrequest.key=4910' '-Dsonar.pullrequest.branch=feat2' '-Dsonar.pullrequest.base=master'
Running on container id: 3dc9aac7bdc2fc7ce762b5130d763f5fb68ebe8a83ba6503e148ad1b324003d4
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< test.bpc.test:BPC_SES_TEST2 >--------------------
[INFO] Building BPC_SES_TEST2 0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:report (default-cli) @ BPC_SES_TEST2 ---
[INFO] Loading execution data file /var/jenkins_home/workspace/SES_TEST2_feat2/target/jacoco.exec
[INFO] Analyzed bundle 'BPC_SES_TEST2' with 1 classes
[INFO] 
[INFO] -------------------< test.bpc.test:BPC_SES_TEST2 >--------------------
[INFO] Building BPC_SES_TEST2 0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ BPC_SES_TEST2 ---
[INFO] User cache: /var/maven/.m2/.sonar/cache
[INFO] SonarQube version: 8.5.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
[INFO] Load global settings
[INFO] Load global settings (done) | time=182ms
[INFO] Server id: 7B147D8D-AWNoJUvbWd67zf03YahC
[INFO] User cache: /var/maven/.m2/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=134ms
[INFO] Load/download plugins (done) | time=456ms
[INFO] Loaded core extensions: developer-scanner
[INFO] JavaScript/TypeScript frontend is enabled
[INFO] Process project properties
[INFO] Process project properties (done) | time=20ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=4ms
[INFO] Project key: test.bpc.test:BPC_SES_TEST2
[INFO] Base dir: /var/jenkins_home/workspace/SES_TEST2_feat2
[INFO] Working dir: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar
[INFO] Load project settings for component key: 'test.bpc.test:BPC_SES_TEST2'
[INFO] Load project settings for component key: 'test.bpc.test:BPC_SES_TEST2' (done) | time=19ms
[INFO] Load project branches
[INFO] Load project branches (done) | time=21ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=92ms
[INFO] Load branch configuration
[INFO] Found manual configuration of branch/PR analysis. Skipping automatic configuration.
[INFO] Load branch configuration (done) | time=6ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=111ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1952ms
[INFO] Pull request 4910 for merge into master from feat2
[INFO] SCM collecting changed files in the branch
[INFO] SCM collecting changed files in the branch (done) | time=280ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO]   Excluded sources: **/dataaccess/entity/**/*.java, **/datatransfer/entity/**/*.java
[INFO] 3 files indexed
[INFO] 0 files ignored because of inclusion/exclusion patterns
[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 BPC_SES_TEST2
[INFO] JavaScript/TypeScript frontend is enabled
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=17ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=25ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=3ms
[INFO] Java Main Files AST scan
[INFO] 1 source files to be analyzed
[INFO] 1/1 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=2365ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[INFO] Java Test Files AST scan (done) | time=135ms
[INFO] 1/1 source files have been analyzed
[INFO] Java Generated Files AST scan
[INFO] 0 source files to be analyzed
[INFO] Java Generated Files AST scan (done) | time=2ms
[INFO] 0/0 source files have been analyzed
[INFO] Sensor JavaSquidSensor [java] (done) | time=2813ms
[INFO] Sensor CSS Rules [cssfamily]
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [cssfamily] (done) | time=2ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=2ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/var/jenkins_home/workspace/SES_TEST2_feat2/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=134ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=241ms
[INFO] Sensor HTML [web]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web] (done) | time=7ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=198ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor VB.NET Properties [vbnet]
[INFO] Sensor VB.NET Properties [vbnet] (done) | time=3ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=34ms
[INFO] Sensor ThymeLeaf template sensor [securityjavafrontend]
[INFO] Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
[INFO] Sensor JavaSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/java
[INFO] Read 30 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/java
[INFO] 08:17:14.364 Building Type propagation graph
[INFO] 08:17:14.376 Running Tarjan on 42 nodes
[INFO] 08:17:14.378 Tarjan found 42 components
[INFO] 08:17:14.383 Variable type analysis: done
[INFO] 08:17:14.384 Building Type propagation graph
[INFO] 08:17:14.386 Running Tarjan on 42 nodes
[INFO] 08:17:14.386 Tarjan found 42 components
[INFO] 08:17:14.387 Variable type analysis: done
[INFO] Analyzing 4 ucfgs to detect vulnerabilities.
[INFO] All rules entrypoints : 0 Retained UCFGs : 0
[INFO] rule: S5131, entrypoints: 0
[INFO] rule: S5131 done
[INFO] rule: S3649, entrypoints: 0
[INFO] rule: S3649 done
[INFO] rule: S2076, entrypoints: 0
[INFO] rule: S2076 done
[INFO] rule: S2091, entrypoints: 0
[INFO] rule: S2091 done
[INFO] rule: S2078, entrypoints: 0
[INFO] rule: S2078 done
[INFO] rule: S2631, entrypoints: 0
[INFO] rule: S2631 done
[INFO] rule: S5135, entrypoints: 0
[INFO] rule: S5135 done
[INFO] rule: S2083, entrypoints: 0
[INFO] rule: S2083 done
[INFO] rule: S5167, entrypoints: 0
[INFO] rule: S5167 done
[INFO] rule: S5144, entrypoints: 0
[INFO] rule: S5144 done
[INFO] rule: S5145, entrypoints: 0
[INFO] rule: S5145 done
[INFO] rule: S5146, entrypoints: 0
[INFO] rule: S5146 done
[INFO] rule: S5334, entrypoints: 0
[INFO] rule: S5334 done
[INFO] Sensor JavaSecuritySensor [security] (done) | time=532ms
[INFO] Sensor CSharpSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/ucfg_cs2
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/ucfg_cs2
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor CSharpSecuritySensor [security] (done) | time=2ms
[INFO] Sensor PhpSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/php
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/php
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor PhpSecuritySensor [security] (done) | time=2ms
[INFO] Sensor PythonSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/python
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/python
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor PythonSecuritySensor [security] (done) | time=1ms
[INFO] Sensor JsSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/js
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/js
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor JsSecuritySensor [security] (done) | time=2ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=1ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=36ms
[INFO] SCM Publisher SCM provider for this project is: git
[INFO] SCM Publisher 3 source files to be analyzed
[INFO] SCM Publisher 3/3 source files have been analyzed (done) | time=299ms
[INFO] CPD Executor Calculating CPD for 1 file
[INFO] CPD Executor CPD calculation finished (done) | time=22ms
[INFO] SCM writing changed lines
[INFO] SCM writing changed lines (done) | time=56ms
[INFO] Analysis report generated in 178ms, dir size=167 KB
[INFO] Analysis report compressed in 40ms, zip size=30 KB
[INFO] Analysis report uploaded in 29ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://mycompany/sonar/dashboard?id=test.bpc.test%3ABPC_SES_TEST2&pullRequest=4910
[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 http://mycompany/sonar/api/ce/task?id=AXUb4pScPERCKEA5Phgc
[INFO] Analysis total time: 14.100 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.150 s
[INFO] Finished at: 2020-10-12T08:17:15Z
[INFO] ------------------------------------------------------------------------

Here the same log but when i used the branch argument for the scanner (in thise case i have the test and coverage metrics in the report) :

+ ./mvnw -B org.jacoco:jacoco-maven-plugin:0.8.5:report org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectVersion=57' '-Dsonar.branch.name=feat2'
Running on container id: a42dd6663d117aa17f2c6b18f2a5a052d7594c3432d34975d01171eeceb103c5
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< test.bpc.test:BPC_SES_TEST2 >--------------------
[INFO] Building BPC_SES_TEST2 0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- jacoco-maven-plugin:0.8.5:report (default-cli) @ BPC_SES_TEST2 ---
[INFO] Loading execution data file /var/jenkins_home/workspace/SES_TEST2_feat2/target/jacoco.exec
[INFO] Analyzed bundle 'BPC_SES_TEST2' with 1 classes
[INFO] 
[INFO] -------------------< test.bpc.test:BPC_SES_TEST2 >--------------------
[INFO] Building BPC_SES_TEST2 0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ BPC_SES_TEST2 ---
[INFO] User cache: /var/maven/.m2/.sonar/cache
[INFO] SonarQube version: 8.5.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[WARNING] SonarScanner will require Java 11 to run starting in SonarQube 8.x
[INFO] Load global settings
[INFO] Load global settings (done) | time=214ms
[INFO] Server id: 7B147D8D-AWNoJUvbWd67zf03YahC
[INFO] User cache: /var/maven/.m2/.sonar/cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=138ms
[INFO] Load/download plugins (done) | time=494ms
[INFO] Loaded core extensions: developer-scanner
[INFO] JavaScript/TypeScript frontend is enabled
[INFO] Process project properties
[INFO] Process project properties (done) | time=18ms
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=4ms
[INFO] Project key: test.bpc.test:BPC_SES_TEST2
[INFO] Base dir: /var/jenkins_home/workspace/SES_TEST2_feat2
[INFO] Working dir: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar
[INFO] Load project settings for component key: 'test.bpc.test:BPC_SES_TEST2'
[INFO] Load project settings for component key: 'test.bpc.test:BPC_SES_TEST2' (done) | time=60ms
[INFO] Load project branches
[INFO] Load project branches (done) | time=49ms
[INFO] Load project pull requests
[INFO] Load project pull requests (done) | time=219ms
[INFO] Load branch configuration
[INFO] Found manual configuration of branch/PR analysis. Skipping automatic configuration.
[INFO] Load branch configuration (done) | time=5ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=142ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=2772ms
[INFO] Branch name: feat2
[INFO] Indexing files...
[INFO] Project configuration:
[INFO]   Excluded sources: **/dataaccess/entity/**/*.java, **/datatransfer/entity/**/*.java
[INFO] 3 files indexed
[INFO] 0 files ignored because of inclusion/exclusion patterns
[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 BPC_SES_TEST2
[INFO] JavaScript/TypeScript frontend is enabled
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=27ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=25ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=3ms
[INFO] Java Main Files AST scan
[INFO] 1 source files to be analyzed
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=88ms
[INFO] 1/1 source files have been analyzed
[INFO] Java Main Files AST scan (done) | time=2605ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[INFO] Java Test Files AST scan (done) | time=134ms
[INFO] 1/1 source files have been analyzed
[INFO] Java Generated Files AST scan
[INFO] 0 source files to be analyzed
[INFO] Java Generated Files AST scan (done) | time=1ms
[INFO] 0/0 source files have been analyzed
[INFO] Sensor JavaSquidSensor [java] (done) | time=3061ms
[INFO] Sensor CSS Rules [cssfamily]
[INFO] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[INFO] Sensor CSS Rules [cssfamily] (done) | time=2ms
[INFO] Sensor C# Properties [csharp]
[INFO] Sensor C# Properties [csharp] (done) | time=2ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [/var/jenkins_home/workspace/SES_TEST2_feat2/target/surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=129ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=236ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web]
[INFO] Sensor HTML [web] (done) | time=7ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=208ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor VB.NET Properties [vbnet]
[INFO] Sensor VB.NET Properties [vbnet] (done) | time=3ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[INFO] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=33ms
[INFO] Sensor ThymeLeaf template sensor [securityjavafrontend]
[INFO] Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
[INFO] Sensor JavaSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/java
[INFO] Read 30 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/java
[INFO] 19:56:43.383 Building Type propagation graph
[INFO] 19:56:43.4 Running Tarjan on 42 nodes
[INFO] 19:56:43.403 Tarjan found 42 components
[INFO] 19:56:43.41 Variable type analysis: done
[INFO] 19:56:43.411 Building Type propagation graph
[INFO] 19:56:43.413 Running Tarjan on 42 nodes
[INFO] 19:56:43.414 Tarjan found 42 components
[INFO] 19:56:43.415 Variable type analysis: done
[INFO] Analyzing 4 ucfgs to detect vulnerabilities.
[INFO] All rules entrypoints : 0 Retained UCFGs : 0
[INFO] rule: S5131, entrypoints: 0
[INFO] rule: S5131 done
[INFO] rule: S3649, entrypoints: 0
[INFO] rule: S3649 done
[INFO] rule: S2076, entrypoints: 0
[INFO] rule: S2076 done
[INFO] rule: S2091, entrypoints: 0
[INFO] rule: S2091 done
[INFO] rule: S2078, entrypoints: 0
[INFO] rule: S2078 done
[INFO] rule: S2631, entrypoints: 0
[INFO] rule: S2631 done
[INFO] rule: S5135, entrypoints: 0
[INFO] rule: S5135 done
[INFO] rule: S2083, entrypoints: 0
[INFO] rule: S2083 done
[INFO] rule: S5167, entrypoints: 0
[INFO] rule: S5167 done
[INFO] rule: S5144, entrypoints: 0
[INFO] rule: S5144 done
[INFO] rule: S5145, entrypoints: 0
[INFO] rule: S5145 done
[INFO] rule: S5146, entrypoints: 0
[INFO] rule: S5146 done
[INFO] rule: S5334, entrypoints: 0
[INFO] rule: S5334 done
[INFO] Sensor JavaSecuritySensor [security] (done) | time=491ms
[INFO] Sensor CSharpSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/ucfg_cs2
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/ucfg_cs2
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor CSharpSecuritySensor [security] (done) | time=2ms
[INFO] Sensor PhpSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/php
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/php
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor PhpSecuritySensor [security] (done) | time=2ms
[INFO] Sensor PythonSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/python
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/python
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor PythonSecuritySensor [security] (done) | time=2ms
[INFO] Sensor JsSecuritySensor [security]
[INFO] Reading type hierarchy from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/js
[INFO] Read 0 type definitions
[INFO] Reading UCFGs from: /var/jenkins_home/workspace/SES_TEST2_feat2/target/sonar/ucfg2/js
[INFO] No UCFGs have been included for analysis.
[INFO] Sensor JsSecuritySensor [security] (done) | time=2ms
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=1ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=35ms
[INFO] SCM Publisher SCM provider for this project is: git
[INFO] SCM Publisher 1 source file to be analyzed
[INFO] SCM Publisher 1/1 source file have been analyzed (done) | time=367ms
[INFO] CPD Executor Calculating CPD for 1 file
[INFO] CPD Executor CPD calculation finished (done) | time=23ms
[INFO] Load New Code definition
[INFO] Load New Code definition (done) | time=21ms
[INFO] Analysis report generated in 162ms, dir size=166 KB
[INFO] Analysis report compressed in 36ms, zip size=29 KB
[INFO] Analysis report uploaded in 61ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://mycompany/sonar/dashboard?id=test.bpc.test%3ABPC_SES_TEST2&branch=feat2
[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 http://mycompany/sonar/api/ce/task?id=AXUeYvtOZZs1WSnAJVs9
[INFO] Analysis total time: 15.094 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.672 s
[INFO] Finished at: 2020-10-12T19:56:44Z
[INFO] ------------------------------------------------------------------------

Here the compute engine log with debug level for with the PR arguments scenario :
(by the way i created another thread for the below stacktrace)

2020.10.12 20:20:23 INFO  ce[][o.s.c.t.CeWorkerImpl] Execute task | project=test.bpc.test:BPC_SES_TEST2 | type=REPORT | pullRequest=4910 | id=AXUeeJxRZZs1WSnAJVtD | submitter=admin
2020.10.12 20:20:23 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExtractReportStep] Analysis report is 167 KB uncompressed
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Extract report | status=SUCCESS | time=17ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist scanner context | status=SUCCESS | time=4ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Propagate analysis warnings from scanner report | status=SUCCESS | time=0ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Generate analysis UUID | status=SUCCESS | time=0ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load analysis metadata | status=SUCCESS | time=9ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Initialize | status=SUCCESS | time=12ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Verify billing | status=SUCCESS | time=0ms
2020.10.12 20:20:23 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Build tree of components | components=7 | status=SUCCESS | time=17ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Validate project | status=SUCCESS | time=5ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load quality profiles | status=SUCCESS | time=409ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load Quality gate | status=SUCCESS | time=4ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=SUCCESS | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.f.FileMoveDetectionStep] Either no files added or no files removed. Do nothing.
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Detect file moves | reportFiles=3 | dbFiles=3 | addedFiles=0 | status=SUCCESS | time=6ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load duplications | duplications=1 | status=SUCCESS | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.d.CrossProjectDuplicationStatusHolderImpl] Cross project duplication is disabled because it's disabled in the analysis report
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute cross project duplications | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute size measures | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute new coverage | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute coverage measures | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute comment measures | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Copy custom measures | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute duplication measures | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute size measures on new code | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute language distribution | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute test measures | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=7ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   Execution time for each component visitor:
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - LoadComponentUuidsHavingOpenIssuesVisitor | time=1ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - IntegrateIssuesVisitor | time=22ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - CloseIssuesOnRemovedComponentsVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - MaintainabilityMeasuresVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewMaintainabilityMeasuresVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - ReliabilityAndSecurityRatingMeasuresVisitor | time=1ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewReliabilityAndSecurityRatingMeasuresVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - SecurityReviewMeasuresVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewSecurityReviewMeasuresVisitor | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - LastCommitVisitor | time=3ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.ExecuteVisitorsStep]   - MeasureComputersVisitor | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=35ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=7ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=1ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Compute Quality profile measures | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Generate Quality profile events | status=SUCCESS | time=4ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Generate Quality gate events | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Check upgrade possibility for not analyzed code files. | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist components | status=SUCCESS | time=6ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist analysis | status=SUCCESS | time=2ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist analysis properties | status=SUCCESS | time=2ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist measures | inserts=60 | status=SUCCESS | time=8ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=421 | status=SUCCESS | time=55ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist duplication data | insertsOrUpdates=0 | status=SUCCESS | time=3ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist new ad hoc Rules | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist issues | cacheSize=0 bytes | inserts=0 | updates=0 | merged=0 | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist project links | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist events | status=SUCCESS | time=9ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist sources | status=SUCCESS | time=26ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Persist cross project duplications | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Enable analysis | status=SUCCESS | time=3ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Update last usage date of quality profiles | status=SUCCESS | time=8ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per day between 2020-09-14 and 2020-10-11
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXUHgtNIM-0wlop0s6iM: 
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per week between 2019-10-14 and 2020-09-14
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXUHgtNIM-0wlop0s6iM: 
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per month between 2015-10-19 and 2019-10-14
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXUHgtNIM-0wlop0s6iM: 
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.KeepWithVersionFilter] -> Keep analyses with a version prior to 2018-10-15
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXUHgtNIM-0wlop0s6iM: 
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DeleteAllFilter] -> Delete data prior to: 2015-10-19
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXUHgtNIM-0wlop0s6iM: 
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.purge.PurgeDao] <- Delete aborted builds
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.d.purge.PurgeDao] <- Purge stale branches
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Purge db | status=SUCCESS | time=31ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.measure.index.ProjectMeasuresIndexer@70974c62
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.component.index.ComponentIndexer@62f6038c
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.issue.index.IssueIndexer@531ce32a
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Index analysis | status=SUCCESS | time=69ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Update need issue sync for branch | status=SUCCESS | time=4ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | status=SUCCESS | time=0ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][o.s.s.w.WebHooksImpl] Sent webhook 'Jenkins webhook' | url=http://mycompany/jenkins/sonarqube-webhook/ | time=10ms | status=200
2020.10.12 20:20:24 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=1 | projectWebhooks=0 | status=SUCCESS | time=19ms
2020.10.12 20:20:24 DEBUG ce[AXUeeJxRZZs1WSnAJVtD][GitlabPrHttpClient] get project url : [https://mycompany/gitlab/projects/196]
2020.10.12 20:20:25 ERROR ce[AXUeeJxRZZs1WSnAJVtD][c.s.C.D.D.B] An exception was thrown during Merge Request decoration : java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2020.10.12 20:20:25 ERROR ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Execution of task class com.sonarsource.C.D.c failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
	at com.sonarsource.C.D.D.G.A(Unknown Source)
	at com.sonarsource.C.D.D.B.A(Unknown Source)
	at com.sonarsource.C.D.D.B.A(Unknown Source)
	at com.sonarsource.C.D.c.A(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at com.sonarsource.C.D.c.B(Unknown Source)
	at com.sonarsource.C.D.c.A(Unknown Source)
	at org.sonar.ce.async.SynchronousAsyncExecution.addToQueue(SynchronousAsyncExecution.java:27)
	at com.sonarsource.C.D.c.A(Unknown Source)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at com.sonarsource.C.D.c.finished(Unknown Source)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:118)
	at org.sonar.ce.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:109)
	at org.sonar.ce.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:91)
	at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:63)
	at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:235)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:217)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:162)
	at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:137)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:89)
	at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:226)
	at com.google.gson.Gson.fromJson(Gson.java:932)
	at com.google.gson.Gson.fromJson(Gson.java:897)
	at com.google.gson.Gson.fromJson(Gson.java:846)
	at com.google.gson.Gson.fromJson(Gson.java:817)
	at com.sonarsource.C.D.D.F.A(Unknown Source)
	... 31 common frames omitted
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
	at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:386)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
	... 36 common frames omitted
2020.10.12 20:20:25 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=FAILED | time=282ms
2020.10.12 20:20:25 INFO  ce[AXUeeJxRZZs1WSnAJVtD][o.s.c.t.CeWorkerImpl] Executed task | project=test.bpc.test:BPC_SES_TEST2 | type=REPORT | pullRequest=4910 | id=AXUeeJxRZZs1WSnAJVtD | submitter=admin | status=SUCCESS | time=1154ms

And finally, here the compute engine log with debug level for with the branch arguments scenario :

2020.10.12 20:23:19 INFO  ce[][o.s.c.t.CeWorkerImpl] Execute task | project=test.bpc.test:BPC_SES_TEST2 | type=REPORT | branch=feat2 | branchType=BRANCH | id=AXUee016ZZs1WSnAJVtF | submitter=admin
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExtractReportStep] Analysis report is 165 KB uncompressed
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Extract report | status=SUCCESS | time=11ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist scanner context | status=SUCCESS | time=3ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Propagate analysis warnings from scanner report | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Generate analysis UUID | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load analysis metadata | status=SUCCESS | time=6ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Initialize | status=SUCCESS | time=5ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Verify billing | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Build tree of components | components=7 | status=SUCCESS | time=5ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Validate project | status=SUCCESS | time=3ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load quality profiles | status=SUCCESS | time=394ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load Quality gate | status=SUCCESS | time=2ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.p.NewCodePeriodResolver] Resolving new code period with a specific analysis
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load new code period | status=SUCCESS | time=2ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.f.FileMoveDetectionStep] Either no files added or no files removed. Do nothing.
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Detect file moves | reportFiles=3 | dbFiles=3 | addedFiles=0 | status=SUCCESS | time=2ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load duplications | duplications=1 | status=SUCCESS | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.d.CrossProjectDuplicationStatusHolderImpl] Cross project duplication is disabled because it's disabled in the analysis report
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute cross project duplications | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute size measures | status=SUCCESS | time=1ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute new coverage | status=SUCCESS | time=18ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute coverage measures | status=SUCCESS | time=1ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute comment measures | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Copy custom measures | status=SUCCESS | time=4ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute duplication measures | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute size measures on new code | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute language distribution | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute test measures | status=SUCCESS | time=1ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=2ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=10ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   Execution time for each component visitor:
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - LoadComponentUuidsHavingOpenIssuesVisitor | time=2ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - IntegrateIssuesVisitor | time=22ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - CloseIssuesOnRemovedComponentsVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - MaintainabilityMeasuresVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewMaintainabilityMeasuresVisitor | time=1ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - ReliabilityAndSecurityRatingMeasuresVisitor | time=1ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewReliabilityAndSecurityRatingMeasuresVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - SecurityReviewMeasuresVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - NewSecurityReviewMeasuresVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - LastCommitVisitor | time=0ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.ExecuteVisitorsStep]   - MeasureComputersVisitor | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=27ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=4ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=1ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Compute Quality profile measures | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Generate Quality profile events | status=SUCCESS | time=3ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Generate Quality gate events | status=SUCCESS | time=4ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Check upgrade possibility for not analyzed code files. | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist components | status=SUCCESS | time=5ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist analysis | status=SUCCESS | time=1ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist analysis properties | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist measures | inserts=61 | status=SUCCESS | time=8ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist live measures | insertsOrUpdates=410 | status=SUCCESS | time=51ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist duplication data | insertsOrUpdates=0 | status=SUCCESS | time=2ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist new ad hoc Rules | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist issues | cacheSize=0 bytes | inserts=0 | updates=0 | merged=0 | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist project links | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist events | status=SUCCESS | time=4ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist sources | status=SUCCESS | time=18ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Persist cross project duplications | status=SUCCESS | time=0ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Enable analysis | status=SUCCESS | time=9ms
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Update last usage date of quality profiles | status=SUCCESS | time=12ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per day between 2020-09-14 and 2020-10-11
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXPdtG3ZBZ5DW1Wi9-MS: 
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per week between 2019-10-14 and 2020-09-14
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXPdtG3ZBZ5DW1Wi9-MS: 
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.KeepOneFilter] -> Keep one snapshot per month between 2015-10-19 and 2019-10-14
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXPdtG3ZBZ5DW1Wi9-MS: 
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.KeepWithVersionFilter] -> Keep analyses with a version prior to 2018-10-15
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXPdtG3ZBZ5DW1Wi9-MS: 
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DeleteAllFilter] -> Delete data prior to: 2015-10-19
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.p.p.DefaultPeriodCleaner] <- Delete analyses of component AXPdtG3ZBZ5DW1Wi9-MS: 
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.purge.PurgeDao] <- Delete aborted builds
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.d.purge.PurgeDao] <- Purge stale branches
2020.10.12 20:23:19 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Purge db | status=SUCCESS | time=29ms
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.measure.index.ProjectMeasuresIndexer@70974c62
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.component.index.ComponentIndexer@62f6038c
2020.10.12 20:23:19 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.s.IndexAnalysisStep] Call org.sonar.server.issue.index.IssueIndexer@531ce32a
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Index analysis | status=SUCCESS | time=121ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Update need issue sync for branch | status=SUCCESS | time=1ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Send issue notifications | newIssuesNotifs=0 | newIssuesDeliveries=0 | myNewIssuesNotifs=0 | myNewIssuesDeliveries=0 | changesNotifs=0 | changesDeliveries=0 | status=SUCCESS | time=5ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Publish task results | status=SUCCESS | time=0ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.s.ComputationStepExecutor] Trigger refresh of Portfolios and Applications | status=SUCCESS | time=0ms
2020.10.12 20:23:20 DEBUG ce[AXUee016ZZs1WSnAJVtF][o.s.s.w.WebHooksImpl] Sent webhook 'Jenkins webhook' | url=http://mycompany/jenkins/sonarqube-webhook/ | time=9ms | status=200
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Webhooks | globalWebhooks=1 | projectWebhooks=0 | status=SUCCESS | time=14ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.p.a.p.PostProjectAnalysisTasksExecutor] Pull Request decoration | status=SUCCESS | time=1ms
2020.10.12 20:23:20 INFO  ce[AXUee016ZZs1WSnAJVtF][o.s.c.t.CeWorkerImpl] Executed task | project=test.bpc.test:BPC_SES_TEST2 | type=REPORT | branch=feat2 | branchType=BRANCH | id=AXUee016ZZs1WSnAJVtF | submitter=admin | status=SUCCESS | time=842ms

Thank you again and sorry for these massive messages

Hi,

I’m thinking this is not a bug. Pull Request Analysis are focused on new code and to provide a status for the quality gate. And because, there is no “test” and “coverage” metrics in the quality gate, the pull request doesn’t display them.

So, i can’t replace branch analysis by pull request analysis in our case. Moreover the branch analysis cannot be dynamic like the pull request analysis, so I will disable branch analysis for some of our feature branches.

To summarize our projects have 4 kind of branches :

  • MASTER: new code = diff from previous version from MASTER
    • Sonarqube conf : ‘Previous version’
  • Feature branch from master : new code = diff from MASTER
    • Sonaqube conf : ‘Reference branch: master’ (default for the project)
  • STABLE-xxx : new code = diff from previous version from STABLE-xxx
    • Sonarqube conf : ‘Previous version’
  • Feature branch from stable-xxx: new code = diff from STABLE-xxx
    • Sadly, this usecase cannot been implemented, because of the limitations of SQ, so we will disable the SQ scan for these branches.

François