| |
@@ -82,6 +82,7 @@
|
| |
|
| |
def set_zuul_settings(client, project, gating, host):
|
| |
logging.debug("Get settings config on %s" % project)
|
| |
+ acl_level = 'ticket'
|
| |
config = client.get_config(project)
|
| |
config['Web-hooks'] = BASE_WH_URL % host
|
| |
config['pull_requests'] = True
|
| |
@@ -89,20 +90,22 @@
|
| |
config['Minimum_score_to_merge_pull-request'] = 0
|
| |
config['open_metadata_access_to_all'] = False
|
| |
client.set_tags(project, ['gateit'])
|
| |
+ acl_level = 'commit'
|
| |
# convert value https://pagure.io/pagure/issue/4712
|
| |
for k, v in config.items():
|
| |
if isinstance(v, bool):
|
| |
config[k] = 1 if v else 0
|
| |
client.set_config(project, config)
|
| |
logging.debug("Applying new setting set on %s" % project)
|
| |
- if gating:
|
| |
- acls = {
|
| |
- 'user_type': 'user',
|
| |
- 'name': 'zuul',
|
| |
- 'acl': 'commit'
|
| |
- }
|
| |
- client.set_acl(project, acls)
|
| |
- logging.debug("Adding zuul user as admin on %s" % project)
|
| |
+ acls = {
|
| |
+ 'user_type': 'user',
|
| |
+ 'name': 'zuul',
|
| |
+ 'acl': acl_level
|
| |
+ }
|
| |
+ client.set_acl(project, acls)
|
| |
+ logging.debug(
|
| |
+ "Adding zuul user as %s collaborator on %s" % (
|
| |
+ acl_level, project))
|
| |
|
| |
|
| |
def process(client, projects, gating, host):
|
| |
To avoid using webhook payload source whitelisting Pagure 5.9
provided an endpoint to fetch the webhook token from the API
with the minimum required ACL collaborator level: ticket.
Zuul can now use that endpoint to fetch the token.
This change ensure the zuul user is added as Ticket collaborator
in projects.