-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] 10.3 SQ + 1.18.0 plugin release "No branch exists in Sonarqube with the name" for a PR to non existing branch #854
Comments
@mc1arke I'm having a similar issue when running a PR build but I've verified that the "master" branch exists in the SonarQube project. Any suggestions on how to fix this? |
According to the code in the Sonar Scanner VSTS extension it is pulling the target branch name from System.PullRequest.TargetBranch and should be getting a substring that excludes "refs/heads". Any ideas why since I updated to SonarQube 10.3 and the latest extension version it's giving me the errors above? |
I found that my issue was caused by build pipelines running older versions of the SonarQubePrepare, SonarQubeAnalyze, and SonarQubePublish VSTS pipelines tasks. By updating them to v5 tasks it resolved the issue. SonarQubePrepare@5 |
How did this work correctly in previous versions then? The situation we have is not related to project creation, the project and its master and dev branches exist in SQ and are analyzed regularly, we are getting this issue when we try to do a PR into a temp release or hotfix branch. I would consider this a breaking change for the plugin, which is not indicated by only increasing the minor release version. |
@jovanz-getbgd it defaulted to using your project's 'default' branch as the reference branch. This meant that the baselines were incorrect and Sonarqube was reporting misleading reference information. It may cause problems in workflows that haven't pre-scanned target branches, but I wouldn't class it as a breaking change since the process wasn't working properly for those scans anyway. |
Thanks so much for a detailed explanation. Makes total sense now. |
hi @jeremytbrun , I wanna ask how you solve this issue? because I face it now. I use I'm a bit confused, where can i update this to v5? |
Same issue faced when opening PRs against release branches. Before we were able to analyze new PRs against a release branch but now with the new version it isn't possible. I think the old function was actually helpful as we were able to analyze bugfixes or additional features. |
Hi,
We use Azure DevOps and when we try to analyze a PR merge to a non-existing branch in SQ, we receive an error "No branch exists in Sonarqube with the name xxxx"
This is a check which exists here, in plugin: https://github.com/mc1arke/sonarqube-community-branch-plugin/blob/5e5ca504c435f5844f86feee02880469344c7de7/src/main/java/com/github/mc1arke/sonarqube/plugin/scanner/BranchConfigurationFactory.java#L50C31-L50C31
The branch really doesn't exist, so to make it works we had to run analyze on the branch itself and then - PR merge.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Software Versions
Additional context
We haven't faced with it before (we are using SQ CE versions 9.8, 9.9, 10 with the plugin for more then year), so it might be some missing functionality, but on the other hand the check tells that it is intendent. SQ documentation doesn't show anything useful for this case.
The text was updated successfully, but these errors were encountered: