PR analysis on multiple projects

(Alexandru Antonica) #1

Hi,

I’m using Sonarqube server 7.6 dev edition, Jenkins ( with Pull request builder) and Bitbucket Cloud.
I’m trying to get my PRs analysed and posting comments on them but i’m getting this:

[INFO] 13:56:41.986 Load project settings
[DEBUG] 13:56:41.992 GET 404 https://my.sonar/api/settings/values.protobuf?component=com.project%3Aname | time=6ms
[INFO] 13:56:42.051 Load project branches
[DEBUG] 13:56:42.057 GET 404 https://my.sonar/api/project_branches/list?project=com.project%3Aname | time=6ms
[DEBUG] 13:56:42.057 Could not process project branches - continuing without it
[INFO] 13:56:42.057 Load project branches (done) | time=6ms
[INFO] 13:56:42.058 Load project pull requests
[DEBUG] 13:56:42.063 GET 404 https://my.sonar/api/project_pull_requests/list?project=com.project%3Aname | time=5ms
[DEBUG] 13:56:42.063 Could not process project pull requests - continuing without it
[INFO] 13:56:42.063 Load project pull requests (done) | time=5ms
[INFO] 13:56:42.064 Load branch configuration
[DEBUG] 13:56:42.068 Found manual configuration of branch/PR analysis. Skipping automatic configuration.

The way i’ve structured my repo is:

  • root
    • pom.xml file with
    • project 1 (with sonar.prop file)
    • project 2 (with sonar.prop file)
    • project 3 (with sonar.prop file)

The pom file has

<groupId>com.project</groupId> 
<artifactId>name</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Name :: Parent Project</name>

When the jenkins build is getting triggered i’m executing this:

mvn --batch-mode -V -U -e \
-Dsurefire.useFile=false sonar:sonar \
-Dsonar.host.url=https://my.sonar\
-Dsonar.login=<token> -X \
-Dsonar.pullrequest.base=$targetBranch$sourceBranch \
-Dsonar.pullrequest.branch=$sourceBranch \
-Dsonar.pullrequest.key=$pullRequestId \
-Dsonar.pullrequest.provider=bitbucketcloud \
-Dsonar.pullrequest.bitbucketcloud.owner=$repositoryOwner \
-Dsonar.pullrequest.bitbucketcloud.repository=$repositoryName

Given the fact that all the projects are in the same repo, PR could include changes form multiple projects. Is there a way to analyse PRs like this?

Thank you.

(G Ann Campbell) #4

Hi,

BitBucket Cloud isn’t supported for SonarQube. We anticipate that SQ 7.7 will support BitBucket Server.

 
Ann