Unable to update the long-lasting branch of my repo

Template for a good new topic, formatted with Markdown:

  • ALM used (GitLab)
  • CI system used (Gitlab runner)
  • Pipeline generated
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • I am unable to change the Long-Lasting branch name
  • Steps to reproduce
    • I created a project and added my GitLab repo after adding the required tokens etc.
    • Now when my pipeline runs it select the main branch as the Long Lasting Branch.
    • I tried to edit the regex to (develop_*). but still it picks the main branch as the LongLasting Branch.
  • I could not find any workaround on this.
  • I have admin rights but cant still change the default branch

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi,

Welcome to the community!

There is no ability to change which branch is the main branch on SonarQube Cloud.

 
Ann

So how do I get the long lasting branch assigned as I cannot get the different analysis like new code etc.

Hi,

I don’t understand the question. If you need to change which branch is seen as ‘main’ you have 2 options:

  • nuclear: delete the project and start over, with the loss of all history
  • disjoint: rename the current main branch to the name of the desired main and delete the current branch with that name. Again, there’s a history loss, but less catastrophic.

 
HTH,
Ann

Thanks Ann. Renaming the main branch worked. Thank you for your help

1 Like