I’m setting up Azure DevOps pull request decoration. After reading sonar documentation, I’ve added these properties to my sonar Prepare Analysis Configuration step:
sonar.pullrequest.key=$(System.PullRequest.PullRequestId) sonar.pullrequest.branch=$(System.PullRequest.SourceBranch) sonar.pullrequest.base=$(System.PullRequest.TargetBranch)
is this the intended approach? it seems like sonar expects values for branch name here like ‘develop’ or ‘feature/whatever’ but the values of pull request variables, like $(System.PullRequest.SourceBranch) are the full branch path ‘refs/heads/develop’. Sonar shows a warning that leads me to believe I’m not doing something correctly:
Could not find ref ‘refs/heads/develop’ in refs/heads or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
Are the above DevOps build variables I’m using the intended approach?