Advice on development of multiple releases

Hello,

can anyone advise how to approach parallel development of multiple releases with SonarQube Enterprise Edition 8.9? Until now we have been working on development of a release of our software product composed of multiple services. For that we have main release branch R1 and feature branches that are merged to this main release branch. So in each Sonar project, we had setup that R1 is long lived branch and definition of new code is configured as difference against R1 branch.

Now we are starting development of the future release R2 while the work on release R1 is still ongoing. Some of the feature branches will be merged into R1 while the rest into R2. We found a setting in SonarQube UI which allows to change definition of New code per branch, but that branch has to be created in SonarQube project and only then it can be reconfigured, which is very cumbersome.

There seems to be no possibility to define different New code settings e.g. per branch name pattern. We are also considering to create separate projects in SonarQube for R2 release, but that would mean manual copying of all issue resolutions from R1 projects into R2 projects at the beginning.

Are there some best practices for SonarQube when working on two or more major releases in parallel?

We will be grateful for any advice.

Best regards,
Tomas Hansut

Hi Tomas,

I think you’re looking for sonar.newCode.referenceBranch. From the docs

Defines the new code period for this branch to use the given branch as a reference branch, overriding the server’s setting.

It only works on the first analysis of a branch, but it should do exactly what you’re after.

 
HTH,
Ann

Hi Ann,

thank you for your reply. I tried this, but it doesn’t work on our SonarQube. After analysis, the new code definition for the feature branches is always the same as the setting in project, or general setting in SonarQube, if the project doesn’t override it.
Do you know if there is anything else that needs to be configured for this to work?

Best regards,
Tomas

Hi Tomas,

I’m very sorry! I just re-read your OP and was reminded that you’re on the LTS. That option was added after the LTS & so isn’t available to you.

And since you can’t ‘configure’ a branch before first analysis, you can’t script this to work right. Unfortunately, your best bet is to catch the configuration up after the first analysis of a branch.

 
:slightly_frowning_face:
Ann