Pattern for "Long-lived branches" isn't marking branches properly

  • Our CI system used => Azure DevOps
  • Scanner command used when applicable…:
sonar.exclusions= (few filetypes and top-directories excluded from scanning)
  • Languages of the repository => C#
  • Private project
  • Error observed => no errors from the actual scan, just wrongly matched branches

Hi there!
We have regex for matching long-lived branches set to
but only one branch is marked as long-lived…:

Branches in our VCS are named “master”, “stage” and “dev” (and others that match the ending “.*”, f.e. “stage-sprint”). I’ve tried limiting the pattern to (stage|master|dev) but still only “master” is marked as long-lived.


Was the pattern set to (stage|master|dev).* before or after the first analysis of the stage and dev branches?

A branch’s type is set, immutably, at first analysis. So if you analyzed first an then set the pattern, the branch type won’t be updated for any existing branches.

Your only option would be to delete the branches and start over with them.


Hi Ann!

Honestly speaking, I don’t know that :smile: I’ll remove them from Sonar, run the analysis and will see.

1 Like

And it helped :slight_smile: Thank You a million, Ann :wink:


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.