#4698 Add the GET project/webhook/token endpoint
Merged by pingou. Opened by fbo.
fbo/pagure gettokenendpoint  into  master

Download 4698.patch

This endpoint allows a project's collaborator to access the
project webhook token. It is useful in case a collaborator
user want to react to project events via the webhook system
because it will need to validate the webhook payloads.

In particular, third party applications that need
to react to multiple projects events wont need to be configured
with a long list of token (one for each project) to be able to
validate event's payloads. Instead the application will just
need to access the projects' endpoint to figure out webhook
tokens.

1 new commit added

  • Fix black format

pretty please pagure-ci rebuild

:thumbsup:

hm, let's document what the optional here means as it seems a little bit contradictory with the name of the function

1 new commit added

  • Add a docstring to api_login_required method

rebased onto ae929db147b115460e83d016b6bb99d5ab865f34

The new endpoint needs to be added to the API documentation page (in api/__init__.py)

1 new commit added

  • Add new endpoint doc api_get_project_webhook_token

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

@jlanda is there an issue with the CI ? I'm not sure to get it correctly. :/

@jlanda is there an issue with the CI ? I'm not sure to get it correctly. :/

yep. we're hitting https://bugs.centos.org/view.php?id=16383 all the time :(

Could you or @pingou rebase the pull request?

rebased onto 62fe6abb276cd4c0f4821f642b29823e57089246

@jlanda, @pingou Me and my team would be happy to provide CI capacity via Zuul for the Pagure project. Our Zuul instance is already configured to react to pagure.io's Pull Requests. We can help to bootstrap jobs if needed. Let us know what do you think.

@fbo How difficult would it be to get started with it for pagure.io? Can we have CI that reacts on both PRs and regular pushes?

@ngompa, I think that quite easy. Yes Zuul can react to PR events but also to refs update on Git repositories so we could add jobs on both kind of events.

The process to attach the pagure repository to the Zuul instance of softwarefactory-project.io is:
First:
- Add the webhook target to the url https://softwarefactory-project.io/zuul/api/connection/pagure.io/payload
- Optional, add the zuul user in the "commit" group of the project. This is needed only if you want to enable the gating.
->https://fedoraproject.org/wiki/Zuul-based-ci#Configure_the_repository_for_Zuul

Next the repository must be defined in the Zuul configuration as explained here https://fedoraproject.org/wiki/Zuul-based-ci#Add_the_repository_into_the_Zuul_configuration

Finally, for the pagure project, we could attach the predefined tox job https://fedora.softwarefactory-project.io/zuul/job/tox-py37 and develop custom if needed.

@jlanda, @pingou Me and my team would be happy to provide CI capacity via Zuul for the Pagure project. Our Zuul instance is already configured to react to pagure.io's Pull Requests. We can help to bootstrap jobs if needed. Let us know what do you think.

Sounds great!!!

@fbo Could you please rebase this?

rebased onto e866ab8a7b5951c766984f02a9f7b4697f042e08

05:02:32  Failed tests:
05:02:32  FAILED test: py3-test_pagure_flask_api_project

1 new commit added

  • Fix missing expiration_date for token arg in tests

You're nearly there!

08:40:37  Failed tests:
08:40:37  FAILED test: py3-test_style

1 new commit added

  • Fix black format

:thumbsup:

@fbo Could you squash all the commits into a single one? It seems like this is really a single change...

LGTM befiore a new ci glitch

Yeah, +1 to squash and pray to jenkins

rebased onto c27154a55ca38f71389e360fcb0448aa8623feef

:thumbsup:

I believe this is the "foo" user not pingou

One tiny comment and good to go :)

rebased onto 003b24f0856941f365bb1ab595017ae4af3371e7

Good catch. Fix done.

@fbo Please rebase the PR so it can be merged. :)

rebased onto f483d70e61795b7a75b0371851ba75a176ed4eac

Pull-Request has been merged by pingou

Metadata