#93 Since Pagure 5.9 add by default Zuul as Ticket collaborator
Merged 3 years ago by zuul. Opened 3 years ago by fbo.
fbo/fedora-project-config helper-ticket-level  into  master

@@ -6,7 +6,7 @@ 

  Indeed some specific settings are needed. See:

  https://fedoraproject.org/wiki/Zuul-based-ci#Configure_the_repository_for_Zuul

  

- To create the API key:

+ An API key is needed to use that tool, to create it:

  - https://src.fedoraproject.org/settings

  - API keys

  - Create key with "Modify an existing project" right

@@ -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.

Build succeeded.

rebased onto db5190bbef90503ede2c1e49723b867d431315a2

3 years ago

Build succeeded.

rebased onto 06d97b8

3 years ago

Build succeeded.

Metadata Update from @fbo:
- Pull-request tagged with: gateit

3 years ago

Build succeeded (gate pipeline).

Pull-Request has been merged by zuul

3 years ago