| |
@@ -496,6 +496,20 @@
|
| |
return
|
| |
|
| |
|
| |
+ def match_collaborator_branch(branch_name, branch_patterns):
|
| |
+ """Return true if branch_name matches the given pattern.
|
| |
+
|
| |
+ Examples of patterns (from a src.fedoraproject.org settings page):
|
| |
+ main,features/*
|
| |
+ epel*
|
| |
+ rawhide,f*
|
| |
+ """
|
| |
+ for pattern in branch_patterns.split(','):
|
| |
+ if fnmatch.fnmatch(branch_name, pattern.strip()):
|
| |
+ return True
|
| |
+ return False
|
| |
+
|
| |
+
|
| |
def prompt_for_new_branch(issue_json, issue_body_json, force=False, auto_approve=False):
|
| |
"""
|
| |
A helper function that prompts the user with information on a new branch
|
| |
@@ -577,14 +591,14 @@
|
| |
set(contributors['users']['commit']) | \
|
| |
set(u['user']
|
| |
for u in contributors['users']['collaborators']
|
| |
- if fnmatch.fnmatch(branch_name, u['branches']))
|
| |
+ if match_collaborator_branch(branch_name, u['branches']))
|
| |
|
| |
# Get the list of FAS groups who can maintain the package
|
| |
access_groups = set(contributors['groups']['admin']) | \
|
| |
set(contributors['groups']['commit']) | \
|
| |
set(g['user']
|
| |
for g in contributors['groups']['collaborators']
|
| |
- if fnmatch.fnmatch(branch_name, g['branches']))
|
| |
+ if match_collaborator_branch(branch_name, g['branches']))
|
| |
group_member = False
|
| |
for access_group in access_groups:
|
| |
# Check if the requestor is part of any of the FAS groups who can maintain the package
|
| |
According to the examples in collaborator permissions, it's possible
to specify several rules separated by commas:
However, the new branch utility only allowed one. Here's a possible fix.