Long-lived vs short-lived branches

We are using Azure DevOps yml pipeline that sends a code ADO git repo to SonarCloud for analysis. All pretty standard stuff.

What I am failing to understand is why we have the following explicitly set in SC UI for a particular project:
Long-lived branches pattern:(branch|release|main)-.*
Still while running the analyse task in Azure DevOps we can see:

Branch name: main, type: short-lived

There was a ‘master’ branch no longer in use and only possible to clasify as long-lived.

Must be missing something really as reading from docs, this should all happen automatically.

Hi,

This pattern requires a dash after main (or branch or release) so main doesn’t match :(.

Unfortunately, branch type is immutable in SonarQube Cloud, once established. You’ll need to delete the branch and start over with it after you edit the pattern.

I suggest a pattern of `(branch|release|main)-?.*

 
HTH,
Ann

Thanks Ann. Think what confused us was that we had to delete the original branch. All good now.

Thanks again,

Milen

1 Like