Issue with long live branches in Sonarqube enterprise edition

Hi All,

We are using
Sonarqube 7.9 Enterprise edition
Azure DevOps Sonarscan task v4
Our branch names are
release/4.30.0
release/4.30.1
release/4/31.0

and for prepare analysis task in Azure Task we have defined this
sonar.branch.name=$(Build.SourceBranchName)

and in sonarqube
Long living branches pattern: (master|release/).*

but still for above mentioned branch in sonarqube it shows as short lived branch

Hey Ankit,

SonarQube is probably getting tripped up on the / in your regex. You can see why on https://regex101.com/ if you paste in the expression you’re trying to use.

I would recommend escaping the slash like this:

(master|release\/).*

On a separate topic, out of curiosity, why override the sonar.branch.name parameter? The extension/task should do a good job figuring that all out on its own.

Colin