You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We submit a PR to a branch that doesn't exist in SQ (but already exists in the GitHub repo). For example, in SQ only the "main" branch is listed, while we submit a PR to the "develop" branch. Then, we will get an error "No branch exists in Sonarqube with the name."
Previously, we used Sonarqube version 9.3.0-community and plugin 1.12.0, everything ran normally and there was no error like this.
To Reproduce
Make a PR to a non-existing branch in SQ, let's say to branch "develop"
Expected behavior
Non-existing branch (develop) is created automatically in SQ
There is no error "No branch exists in Sonarqube with the name"
Additional context
My code uses Java Spring (Maven). Meanwhile, I can solve this by adding <sonar.branch.name>develop</sonar.branch.name> in the pom.xml. The effect is that the "develop" branch will appear in SQ. Then I must remove <sonar.branch.name>develop</sonar.branch.name> from the pom.xml and make the PR again. This is quite inconvenient for us, because with the previous version I did not have to do this.
My problem might be similar to #854, but I still don't quite understand how to fix it.
The text was updated successfully, but these errors were encountered:
fourirakbar
changed the title
SQ 10.3.0-community + plugin 1.18.0 got errpr "No branch exists in Sonarqube with the name"
SQ 10.3.0-community + plugin 1.18.0 got error "No branch exists in Sonarqube with the name"
May 10, 2024
@mc1arke having the same error. I would add that this issue raises more concerns as it's affecting a lot of repos doing lots of release and non-main branches. In the original feature we only have to address the issue once during project creation, which is easily mitigated with proper documentation and by following instructions on how to properly create a project. But now we will have to modify CI behavior and also address all new issues on creating new branch scan for each non-main/release branch.
Our CI before the change:
name: CI - Test Automation
on:
workflow_dispatch:
push:
branches:
- develop
pull_request:
Our CI so that we don't get affected by the new feature (we have to remove on push develop):
name: CI - Test Automation
on:
workflow_dispatch:
pull_request:
For us to create non-main branches, we now have to remove and let it run on all branches, which is a lot of wasted resources since we are already running on PR and also it will create a lot of useless branches (since we only need main, or release). Our last option is to totally disable code analysis if the target branch is NOT develop which is not ideal since we also want to analyse some custom or release branches OR add continue-on-error: true on Code analysis which will ignore underlying issues.
Now I understand that the new feature added was to prevent errors at the start of code analysis if no main branch exists, but that error doesn't happen if the project has already been created and we just want to merge to custom branch. Maybe a workaround for this is to only reject on project creation (OR if target branch is main/develop/master) and accept PR analysis if project already exists. Why I suggest this is that we never encountered any error when project already exists.
Describe the bug
We submit a PR to a branch that doesn't exist in SQ (but already exists in the GitHub repo). For example, in SQ only the "main" branch is listed, while we submit a PR to the "develop" branch. Then, we will get an error "No branch exists in Sonarqube with the name."
Previously, we used Sonarqube version 9.3.0-community and plugin 1.12.0, everything ran normally and there was no error like this.
To Reproduce
Expected behavior
Software Versions
SonarQube Version: 10.3.0-community using helm chart
Plugin Version: 1.18.0
Sonar maven scanner version: 3.11.0.3922
Additional context
My code uses Java Spring (Maven). Meanwhile, I can solve this by adding
<sonar.branch.name>develop</sonar.branch.name>
in the pom.xml. The effect is that the "develop" branch will appear in SQ. Then I must remove<sonar.branch.name>develop</sonar.branch.name>
from the pom.xml and make the PR again. This is quite inconvenient for us, because with the previous version I did not have to do this.My problem might be similar to #854, but I still don't quite understand how to fix it.
The text was updated successfully, but these errors were encountered: