We currently have a jenkins pipeline using Multibranch Workflow plugin
. Each git branch execute a sonarqube analysis creating a sonarqube project using the sonar.branch
property. This is very useful because each branch is being analyzed before merge it, the problem appear when a branch is merged with master and disappear on GIT, the project continues on sonarqube and need to be deleted manually.
Is There a way to do it automatically? or any other recomendation?
You can delete a branch in the Branches tab at Project Settings > Branches and Pull Requests.
Default Branch name in Community Edition If you want to change that in SonarQube then there is no user interface option available, as is in higher editions under Administration –> Branches and Pull Requests.
Master / Main Branch This is the default branch and typically corresponds to what's being developed for your next release. This branch is usually known within a development team as "master" or "head" and is analyzed when no specific branch parameters are provided.
On your project, go to Administration / Branches & Pull Requests. There, you will see in the top-right corner a text like this: "Long living branches pattern: (branch|release)-. * ". That means that when the name of the branch starts with branch- or release- , then it will be considered a long-living branch.
The best way to remove SonarQube branch projects is to not push them to the server in the first place. Here are your options:
At SonarSource, we use SonarLint and the GitHub Plugin on a daily basis. One last solution is to delete manually the project using the api/projects/delete web service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With