As we talked, I would like to implement Bitbucket support in Dispatch and pave the ground for other support such as GitLab. I browsed the code a bit and here is how I'm planning to implement it:
- Add a configuration called
provider where you can set either github or bitbucket (defaults to github for backward compatibility)
- Move the Github webhook handling in Webhooks.Controller to his own Webhooks.GitHub module
- Rename the
:create action in Webhooks.Controller for :github which will call the Webhooks.GitHub module (and point the route to :github)
- Create Webhooks.Bitbucket module for handling Bitbucket webhook
- Add a POST
:bitbucket action in Webhooks.Controller which uses the Webhooks.Bitbucket module with a route /webhooks/bitbucket
- Add a BitbucketClient that implements ClientBehaviour.
- Make sure that the Client module is used dependant on
provider config variable.
Anything I forgot? Any recommandation?
As we talked, I would like to implement Bitbucket support in Dispatch and pave the ground for other support such as GitLab. I browsed the code a bit and here is how I'm planning to implement it:
providerwhere you can set eithergithuborbitbucket(defaults to github for backward compatibility):createaction in Webhooks.Controller for:githubwhich will call the Webhooks.GitHub module (and point the route to :github):bitbucketaction in Webhooks.Controller which uses the Webhooks.Bitbucket module with a route/webhooks/bitbucketproviderconfig variable.Anything I forgot? Any recommandation?