diff options
author | Zuul <zuul@review.opendev.org> | 2020-05-13 19:37:40 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-05-13 19:37:40 +0000 |
commit | c7cb64de11106e2c6bf7a640c7c426c4a6797bc4 (patch) | |
tree | 7e4a2b24a6ca72558a8361e4de71efe46ec712e0 | |
parent | 81986bf2ec41dd2acd8b063530f55acfa1fca60c (diff) | |
parent | 13b9364fa1a2d621aa93b41e80fca407b76a283b (diff) | |
download | zuul-c7cb64de11106e2c6bf7a640c7c426c4a6797bc4.tar.gz |
Merge "pagure: Make use of the new project webhook/token endpoint"
-rw-r--r-- | doc/source/reference/drivers/pagure.rst | 9 | ||||
-rw-r--r-- | zuul/driver/pagure/pagureconnection.py | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/doc/source/reference/drivers/pagure.rst b/doc/source/reference/drivers/pagure.rst index 0614ad222..13a7ec272 100644 --- a/doc/source/reference/drivers/pagure.rst +++ b/doc/source/reference/drivers/pagure.rst @@ -24,7 +24,6 @@ Each project to be integrated with Zuul needs: - "Web hook target" set to http://<zuul-web>/zuul/api/connection/<conn-name>/payload -- "Notify on pull-request flag" set to on - "Pull requests" set to on - "Open metadata access to all" set to off (optional, expected if approval based on PR a metadata tag) @@ -32,9 +31,11 @@ Each project to be integrated with Zuul needs: the score requierement (optional, expected if score requierement is defined in a pipeline) -Furthermore, the user must be added as project collaborator **admin** to -be able to read the project's webhook token. This token is used -to validate webhook's payload. +Furthermore, the user must be added as project collaborator +(**ticket** access level), to be able to read the project's +webhook token. This token is used to validate webhook's payload. But +if Zuul is configured to merge pull requests then the access level +must be **commit**. Connection Configuration ------------------------ diff --git a/zuul/driver/pagure/pagureconnection.py b/zuul/driver/pagure/pagureconnection.py index 19a68ef0f..5df701230 100644 --- a/zuul/driver/pagure/pagureconnection.py +++ b/zuul/driver/pagure/pagureconnection.py @@ -65,7 +65,6 @@ from zuul.driver.pagure.paguremodel import PagureTriggerEvent, PullRequest # # Repository settings (to be checked): # - Minimum score to merge pull-request = 0 or -1 -# - Notify on pull-request flag # - Pull requests # - Open metadata access to all (unchecked if approval) # @@ -494,12 +493,12 @@ class PagureAPIClient(): return resp[0] def get_webhook_token(self): - """ A project admin user's api token must be use with that endpoint + """ A project collaborator's api token must be used with that endpoint """ - path = '%s/connector' % self.project + path = '%s/webhook/token' % self.project resp = self.get(self.base_url + path) self._manage_error(*resp) - return resp[0]['connector']['hook_token'] + return resp[0]['webhook']['token'] class PagureConnection(BaseConnection): |