Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webhook support for Bitbucket and GitLab #64

Closed
swissspidy opened this issue Oct 23, 2018 · 2 comments
Closed

Add webhook support for Bitbucket and GitLab #64

swissspidy opened this issue Oct 23, 2018 · 2 comments
Labels
[Status] Help Wanted [Type] Enhancement New functionality [Type] Question Support requests and other types of questions
Milestone

Comments

@swissspidy
Copy link
Collaborator

Although the plugin now theoretically supports fetching projects from Bitbucket and GitLab.com, we don't support receiving webhooks from these providers just yet.

Without that support, the plugin isn't that useful when on these platforms.

Right now we add a custom github-webhook/v1/push-event REST route for consuming incoming GitHub webhooks. This has two big disadvantages:

  • The name is not really uniquely namespaced.
  • The REST callback is very GitHub-specific, e.g. by checking for X-GitHub-Event headers and assuming a certain data structure.

Possible solutions:

  • Add a new traduttore/v1/<provider>-incoming REST route for each provider. Examples:
    • traduttore/v1/github-incoming
    • traduttore/v1/bitbucket-incoming
    • traduttore/v1/gitlab-incoming
    • traduttore/v1/custom-incoming (common route for custom repositories with filterable callback)
  • Deprecate github-webhook/v1/push-event in favor of traduttore/v1/github-incoming
    Migration might be easier with something like Create GitHub App / Bot / Integration #55
  • Alternatively: use only one REST route, e.g. traduttore/v1/incoming-webhook and choose correct handler depending on source. This could be a separate class per source.
    The question here would be how the source could be detected in a reliable matter.

Bitbucket documentation:

https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html
https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html

GitLab documentation:

https://docs.gitlab.com/ee/user/project/integrations/webhooks.html

@swissspidy swissspidy added [Type] Enhancement New functionality [Status] Help Wanted [Type] Question Support requests and other types of questions labels Oct 23, 2018
@swissspidy swissspidy added this to the 3.0.0 milestone Oct 23, 2018
@swissspidy
Copy link
Collaborator Author

Looks like this is the only issue left in the 3.0.0 milestone.

@ocean90 @grappler What do you think of a single traduttore/v1/incoming-webhook route? This way we wouldn't pollute the REST API with a bunch of very similar routes.

@ocean90
Copy link
Member

ocean90 commented Oct 23, 2018

Sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Help Wanted [Type] Enhancement New functionality [Type] Question Support requests and other types of questions
Projects
None yet
Development

No branches or pull requests

2 participants