I created a new project in SoarCloud via AzureDevops integration for an Angular project. I followed the documentation and have my PR executing a build pipeline that is configured with a Prepare analysis on SonarCloud step, then the npm install, build, test scripts, then a Run Code Analysis step, and then a Publish Quality Gate Result step.
My build pipeline works well when doing analysis on non PR triggered builds, and I see my results in SonarCloud.
When the build pipeline is triggered by a PR, the Quality gate is always passing, and I’m not seeing any new code in the Quality gate report.
I also see the following error on the PR branch in SonarCloud:
Could not find ref ‘quotingClient-1.1.0’ in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
The branch indicated in the above message had a previous scan on it with SonarCloud, and I see no documentation indicating that branches need to be manually configured to be fetched.
Update on this bug. This issue occurs when the branch name contains: /
My branch has the following format release/sweetBranch-1.0.0.
When I do a build of the branch, scanning works, and I see the metrics for the new code
When I try a PR into a branch with the aforementioned format, I do not see PR decoration or a failed gate as I would expect. The error message from SonarCould is telling “Could not find ref 'quotingClient-1.1.0”. It is dropping the prefix of release/. It seems the / is causing the branch to not be recognized.
Note. I did a test of changing my branch format to release-sweetBranch-1.0.0 and everything worked as expected.
Is there a way to get branches with / in the name to do PR decorations successfully?