error on sonar developer branch analysis

612 views
Skip to first unread message

Rahul Nair

unread,
Apr 16, 2018, 4:51:47 AM4/16/18
to SonarQube

Hi,

I have updated my Sonar with Developer Edition

But when I set sonar.branch.name and sonar.branch.target, sonar always give the below error
 ERROR: Target branch does not exist on server: feature-ABC

Let's say I have 5 branches in my git repo. I don’t have "master" branch, but I have "develop". Due to some reason, I'm not considering "Develop" branch for the sonar analysis.

Scenario:

Now in other 4 branches, I have taken "feature-ABC" as Long-living branch, I have already created sonar analysis on this branch and project is available.

Another branch "feature-XYZ", I have performed analysis.

FYI, both branches having same source code to be analyzed.You can see , its showing "master" as branch name. I don’t know why.


Now, I added sonar.branch.name=" feature-XYZ " sonar.branch.target=" feature-ABC " in my Jenkinsfile and analyzed branch "feature-XYZ",

Now I'm getting below error:

 

INFO: Load settings for component 'testsonar1_feature-XYZ'

INFO: Load settings for component 'testsonar1_feature-XYZ' (done) | time=77ms

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

INFO: Total time: 5.669s

INFO: Final Memory: 21M/235M

INFO: ------------------------------------------------------------------------

ERROR: Error during SonarQube Scanner execution

ERROR: Target branch does not exist on server: feature-ABC

nicolas...@sonarsource.com

unread,
Apr 16, 2018, 5:26:23 AM4/16/18
to SonarQube
Hi Rahul,

master is just the default name corresponding to the main branch that can be analysed without any sonar.branch.name . You can change that name at project level (Admnistration -> Branches, and actions on the right).

The error you're observing might relate to this (current) known limitation of Branch Support (documented): Analysis of a short-lived branch based on another short-lived branch is not supported.

Nicolas
Reply all
Reply to author
Forward
0 new messages