Slash in branch name in target pull request branch doesn't seem to work

SonarQube Scanner 3.2.0.1227
SonarScanner for MSBuild 4.3.1
SonarQube server 7.3.0

Following the guide here https://docs.microsoft.com/en-us/labs/devops/sonarcloudlab/index

Hi

So I’ve been following the guide above and that all works great. Making a PR from (for example) feature/add-new-thing to master works fine, but as soon as you try to target a branch with a slash in it it seems to fail, seemingly because when said branch is built and analysed (e.g. release/my-cool-release) it ends up on SonarCloud just called ‘my-cool-release’, so when the PR tries to target that branch it ends up erroring saying:

ERROR: Error during SonarQube Scanner execution
ERROR: Pull request with branch does not exist on server: release/my-cool-release

I also tried to create another branch of master called ‘somebranch’ and created a PR from my ‘feature/add-new-thing’ branch into ‘somebranch’ and that works fine, indicating that slashes are messing it up.

We use branch ‘folders’ in VSTS as part of our workflow, so not having this working is definitely a dealbreaker for us.

Our typical flow is feature/release branching, so every sprint we create a new branch off master, release/104 for example - then PR feature branches e.g. feature/add-thing to the release branch (this is where I want the code validation to happen) and then merge back to master on production deployment.

Is this flow possible in SonarCloud - if so, how?

Thanks!

2 Likes

Hi Matt,

This is a regression, due to the unexpected content of the build variable Build.SourceBranchName. I will do a bugfix release very soon.
You can see details here:
https://jira.sonarsource.com/browse/VSTS-165

I just deployed version 1.3.2 of the prepare task. Please confirm that it solves your problem.

2 Likes

Hi, can confirm that fixes it, thanks.

1 Like