Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Branch Permissions

Chris Zoryk
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 13, 2018

Hi,

I'm trying to set branch permissions up, using branch pattern, however it doesn't appear to be working as expected.

 

I want to create a permission so that branches with the following naming convention cannot be deleted or directly written too (only via pull request).

  • develop_1.1
  • develop_2.1
  • develop_3.2

I thought the branch pattern to match this would be: 'develop_?.?' which should match  'develop_' then a single character, followed by a dot and another single character.

I have tried this and it is not working. In BitBucket if you set up conflicting rules then it should give the user a warning (i've tested this against other branch patterns and it does).  As a test I set up a rule for 'develop_?.?' and one for 'develop_3.0' however I don't see any warnings about conflicting rules, which leads me to believe my branch pattern is wrong, however I can't see the problem.

 

bitbucket_branch_permission_error.JPG

 

1 answer

0 votes
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 17, 2018

Hi Christopher,

Can you try with the following patter?

develop_\d+\.\d+ 

There are some online tools to validate regex (for example https://regexr.com/). If you enter the regex above in one of them, they will also provide a detailed explanations of the rule.

For example \d matches any digit character (0-9). Equivalent to [0-9].

 

I changed the regex to be more specific about the branch pattern and restrict the checks only on the branches following the structure in your example. This may not be required, while escaping the . using \. seems to be the missing part.

 

Cheers,

Caterina - Atlassian Support 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events