Consolidate Projects into single multi-branch Project

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

SonarQube CE 8.7.1 → SonarQube DE 8.7.1

  • what are you trying to achieve

We have been using Community Edition for quite some time now and we are upgrading to Developer Edition. In order to scan multiple branches, we have been creating a project for each branch with the project key being <repository-name>/<branch-name>. What we would like to do is consolidate all of these projects into a single project with branch analysis while keeping the historical scan information for the branch analysis.

For example, we have the following SonarQube projects:

my-repository/master
my-repository/feature/new_feature
my-repository/bugfix/resolve_bug
my-repository/hotfix/patch_issue

I would like to consolidate these to a single SonarQube project:

my-repository

with Branch Analysis details for:

master
feature/new_feature
bugfix/resolve_bug
hotfix/patch_issue

  • what have you tried so far

I tried to change the project key for my-repository/master to my-repository and then changing my-repository/feature/new_feature to my-repository with branch /feature/new_feature but cannot duplicate the project key.

Thanks in advance

Hi,

Welcome to the community!

Unfortunately, there’s no functionality for this.

 
:slightly_frowning_face:
Ann

My company is upgrading to developer edition 8.9.6 from community edition, not sure 8.9.6 has merging capability to merge multiple project in to single project. Is there any alternatives to achieve this?

Unfortunately there’s no functionality that would allow you to merge different projects into one. Your best option is to:

  1. Create a new project once you’ve updated to the Developer Edition.
  2. Scan the Master/Main/Trunk branch on your code.
  3. Scan any other branches you need analyzed.

You won’t get the old scan history in your project this way, but you can keep the old projects around as long as needed (maybe 1 year?) as a historic reference. Over time, these old scan results will become less relevant and eventually you’ll just delete the old projects.

2 Likes

Thank you.