Permission Template Regexp not working

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

Hi,

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

Ann

2 Likes

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/

1 Like

Hi there,

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

Thank you!

1 Like

Hi All
Thank you very much for this hint with the dot. I got the same problem and now it is working

2 Likes

what if I want to apply the same permission template to two different types of projectkey’s.

Ex: com.sonar.dev and com.sonar.test

Can I use it something like: com.sonar.dev., com.sonar.test. ( I tried this and it didn’t work for both of them )

Any suggestions?

Hi,

I think you’d just need to search/apply them serially.

 
HTH,
Ann