Enhance new code global settings

Hello,

We have a lot of projects in our company and all of the projects work using the same structure.
They all have a master branch, where we release our code, and a develop branch, where new release are prepared.

We would like to change new code for all of our projects using the following settings:

  • for master and develop, from previous version
  • for all other branch, from reference branch develop

Currently we cannot do that since globally we only have choice between previous version or number of days. Each time a new project is created we have to set manually this configuration.

What I suggest is to allow user to configure the scheme above globally and also given a fallback option if the reference branch is not present (to previous version or number of days).

Hi,

You don’t mention your version. In the latest versions, you can set a reference branch for your New Code Period.

 
HTH,
Ann

Hi,

We have running version 9.5 of Sonar, but on “global level” one can only define New Code based on “Previous Version (default)” and “Number of days”. If you say, one can now set a reference branch, I know that this is possible for project specific settings, but shouldn’t this also be globally available?

Btw, we are using version 9.5 and developer edition.

Cheers,
Mario

Hi Mario,

On the global level there are no branches. :smiley:

 
HTH,
Ann

Hi Ann

Understood ;-), maybe I was no clear enough. So it’s not possible to define a “main” branch on global level, that would be inherited by all “project specific” settings? So the only way would then be to set the “main” branch on each individual one. I find this pretty “cumbersome” in case one has 500+ projects.
For sure it can be configured via passing parameters to the scanner but nevertheless, having this on “global” would make sense in my opinion.

Regards,
Mario

1 Like

Hi Mario,

I confirm that it’s currently not possible to define a default reference branch at the global level. At global level, SonarQube tries to not make any assumption about the branches that exist or will exist in your projects.
Out of curiosity, would you mind sharing why you are using reference branches and not PRs?

Chris