Setting Long-lived branch to Master

We are currently using Gitlab for our CI/CD, 6 months ago we switch from Branch Based development to Tagging based development.

In the Branches Section of SoncarCloud we can still see that the old Development branch was last pushed to 6 months ago, and I’ve set the regex Pattern to “master” to try and update it from Develop → Master

It’s been over a week since the regex change has been made but the master branch isn’t showing as the main branch.

Hi,

That pattern tells SonarCloud which branches are long-lived and which are short-lived. It does not affect which branch is the main branch. Unfortunately, once set, that’s immutable.

What might work is to use the Rename Branch option under the cog menu you’ve highlighted and update “develop” to “master”. Then the next time you analyzed the “master” branch, it should should update your main branch.

Unfortunately, that’s going to leave a 6-month gap in your analysis history and perhaps some discontinuity between the two branches.

The other option would be to restart the project from scratch. :slightly_frowning_face:

 
Ann

I will give the rename a try, and see how it goes.

If not I will recreate it and report back.

Thanks!

1 Like