Hello, I’d like to ask the community about this specific matter, hopefully someone can point me in the right direction. Here are the details:
SonarQube: Enterprise Edition - Version 9.9
Scanner: SonarScanner 4.8.0
Java 11.0.14 Alpine (64-bit)
Linux 4.19.0-18-cloud-amd64 amd64
SonarQube is running as a Docker container inside an AWS EC2 server.
Details about the topic itself:
I have a project in SonarQube that has its own New Code configuration: there is a “development” branch, which is the main branch, and the other branches are compared to it when analyzed (Project setting → Define a specific setting for this project → Reference branch → Choose a branch: development). The “development” branch has its own definition of New Code (it references the “master” branch). So, the “flow” is: feature branches → development → master.
But I have a specific group of branches for releases (e.g. release-2023.1, release-2023.2, etc.). These branches are created from “development” and merged later to “master”. So, they should have the New Code definition just like the “development” branch i.e. Reference branch “master”). What happens is that every time I create a new release branch, I have to run the first scan, then go to the SonarQube UI, manually edit the New Code definition for it (“Set a specific setting for a branch”), to point to “master”, and then run the scan again.
To avoid that, it would be great to have a way to configure what New Code means for a group of branches, where I could use a regular expression, for example “release-.*” and it would automatically cover any branch I create with this pattern.
Is there a workaround to achieve that? Or would that be a new feature that would need to be developed from scratch?