mattermost-community / mattermost-plugin-bitbucket

Mattermost plugin for Bitbucket
Apache License 2.0
6 stars 16 forks source link

Bitbucket Server: Webhooks #122

Open mickmister opened 11 months ago

mickmister commented 11 months ago

When the plugin receives a webhook event from Bitbucket, we parse the HTTP body into data structures defined by the plugin. We’ll need to be able to differentiate between the two different webhook event structures from the two Bitbucket systems.

https://github.com/mattermost/mattermost-plugin-bitbucket/blob/84a4030b48eb91683d9038ba35afacc9ec9e8f92/server/webhookpayload/bitbucket.go#L83 The Webhook.Parse method does most of the logic of parsing the incoming webhook request. Having this method be the defining factor as the WebhookUnmarshaler interface makes sense.

The following webhook event types are currently supported by the plugin:

https://github.com/mattermost/mattermost-plugin-bitbucket/blob/84a4030b48eb91683d9038ba35afacc9ec9e8f92/server/webhook.go#L35

They are implemented in the link below. Only the ones in the above list need to be implemented. The rest can be removed from the code linked below. https://github.com/mattermost/mattermost-plugin-bitbucket/blob/84a4030b48eb91683d9038ba35afacc9ec9e8f92/server/webhookpayload/bitbucket.go#L129

Ticket Link

Epic ticket https://github.com/mattermost/mattermost-plugin-bitbucket/issues/6