Pull Request Analysis Not Working

ALM used - Azure DevOps
CI system used - Azure DevOps
Languages of the repository - .NET
Pull Request from feature/x_123 into release/x_123

When I pull request from feature/x_123 into release/x_123 my pipline analysis runs perfectly. But when I check the Sonarcloud dashboard to review the PR analysis I notice there’s a lack of data.

I have one outstanding warning - “Could not find ref ‘x_123’ 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.”

When my pipeline checkouts out the code it pulls all branches (includes feature/x_123, master, release/x_123 etc)

Should that not say Could not find ref ‘release/x_123’ in refs/heads? - Is this a bug or am I missing some configuration?

Please note I don’t have Pull Request Decorations enabled as I don’t want comments being added into PRs (Is this causing problems?)

I’m merging into release/x_123, not ‘master’ or ‘develop’. In the logs it looks like the sonarcloud task is trying to fetch x_123 rather than release/x_123, is there anyway to stop it from doing that?

Currently blocked by this issue, any help would be greatly appreciated.


09:17:45.318 INFO: Pull request 4250 for merge into nextversion from testbranch
09:17:45.521 WARN: Could not find ref: nextversion in refs/heads, refs/remotes/upstream or refs/remotes/origin

An example of the logs, it seems like the branch name is being trimmed

Seems like this is either a limitation or a gotcha, I’m unable to get this to work with release/nextversion but master works fine.

Could someone give some advice. if I cannot get this to work I’m unable to use SonarCloud as a solution going forwards

Duplicate of Pull Request Analysis Warning Cannot Fetch, closing this now.