Permission Template Regexp not working

permissions
sonarqube

(Maciej Ptak) #1

Hello,

Template for a good bug report:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension) SonarQube 6.7 (build 33306)

I have 2 templates for projects: first is default one without any regexp
Second one is “SFDC-Local*”

When I am creating new project project Keys are made like this “SFDC-Local:branch-name”
and they are not automatically assinged to second permission template.

May I know why it’s like this?

I have also checked options with ProjectKeys=“Sonar.Local:branch-name” and regexp=“Sonar.Local*” - that was also not working.

Best,
Maciej


(G Ann Campbell) #2

Hi,

You’re using bash regex, not “standard” regex. Try SFDC-Local.*

Ann


(Nicolas Bontoux) #3

Hi Maciej,

FYI, a useful tool whenever working with regex: https://regex101.com/

That allows you to validate your approach, independently of any specific tool (like SonarQube).

If we take your example here, we can see that the regex you mentioned does not yield a full match on the entire project key: https://regex101.com/r/UFZjrs/1/


(Maciej Ptak) #4

Hi there,

You are right!
Sorry I was so used to bash then I forgot to check other options.

Thank you!