mattermost / mattermost-plugin-github

GitHub plugin for Mattermost
Apache License 2.0
157 stars 148 forks source link

Investigate supporting GitHub Discussions webhooks #480

Closed mickmister closed 1 week ago

mickmister commented 2 years ago

There is a request to support subscriptions for GItHub Discussions, which is a topic-based discussion tool provided by GitHub. Here's the original request from community:


Hi everyone, apologies if this is the wrong place to raise this. Our team currently love and use the plugin all the time and were wondering if there are plans to add subscriptions for "discussions"? Like how under "features" there are issues, pulls, etc. Would be very handy if "discussions" could be subscribed to, with pretty much the same behaviour as issues, so when created, commented on, etc.

_Issue created from a Mattermost message by @samw._

sibasankarnayak commented 2 years ago

@mickmister tried exploring the solution for this, currently stable version of GitHub webhook is not having event for any discussion event ,there are lot of user who are waiting for it since 2020 hope to see it soon as it is being tested in a private repo from the contributor's GitHub here are some reference of same

https://github.com/github/feedback/discussions/2959 https://github.com/github/feedback/discussions/2943 https://github.com/github/feedback/discussions/3910 https://github.com/github/feedback/discussions/4173

let me know if we want to try the beta model of webhook , not sure but can try it if we can use same.

mickmister commented 2 years ago

@sibasankarnayak Thanks a bunch for looking into this. 1/5 Let's hold off on implementing this until the offering from GitHub is more stable, as this ticket is not particularly a highly requested feature. Hopefully the necessary pieces become part of the go-github package as well.

I'll keep the issue open though since it seems like it does seem to have some traction (based on reactions of the issue).

@hanzei Thoughts on this whole situation?

hanzei commented 2 years ago

:+1: for waiting a bit. Until go-github supports discussion and there is webhook support, there is no reasonable way to implementing this feature request.

Samuel-Webster commented 2 years ago

Hey everyone, just curious if the support from GitHub / other dependencies is there yet to look at supporting this when there is time? I tried to look into it a bit, and it looks like there is now, but I'm not intimate with what's required exactly.

hanzei commented 2 years ago

Everything is there now. https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion covers the API docs and go-github also supports it: https://pkg.go.dev/github.com/google/go-github/v42/github#DiscussionEvent

elewis787 commented 1 month ago

I will take a look at getting this added. Please assign it to me and I will work on adding support for this.

elewis787 commented 1 month ago

Quick update, I will have a PR for this soon. I have not added the ability to directly comment or answer discussions using the GitHub plugin at this time.

My initial approach has been to get the discussion and discussion comments flowing via GitHub webhooks only.

elewis787 commented 1 month ago

Here is a first pass https://github.com/mattermost/mattermost-plugin-github/pull/808.

Please let me know what you would like to see changed! I did not go too deep on the templating.