Open mickmister opened 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.
Webhook.Parse
WebhookUnmarshaler
The following webhook event types are currently supported by the plugin:
https://github.com/mattermost/mattermost-plugin-bitbucket/blob/84a4030b48eb91683d9038ba35afacc9ec9e8f92/server/webhook.go#L35
RepoPushEvent
IssueCreatedEvent
IssueUpdatedEvent
IssueCommentCreatedEvent
PullRequestCreatedEvent
PullRequestUpdatedEvent
PullRequestApprovedEvent
PullRequestUnapprovedEvent
PullRequestDeclinedEvent
PullRequestMergedEvent
PullRequestCommentCreatedEvent
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
Epic ticket https://github.com/mattermost/mattermost-plugin-bitbucket/issues/6
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 theWebhookUnmarshaler
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
RepoPushEvent
IssueCreatedEvent
IssueUpdatedEvent
IssueCommentCreatedEvent
PullRequestCreatedEvent
PullRequestUpdatedEvent
PullRequestApprovedEvent
PullRequestUnapprovedEvent
PullRequestDeclinedEvent
PullRequestMergedEvent
PullRequestCommentCreatedEvent
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