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

GitHub - Check for an existing webhook when subscribing to a repo #378

Closed
aaronrothschild opened this issue Oct 2, 2020 · 6 comments · Fixed by #664
Closed

GitHub - Check for an existing webhook when subscribing to a repo #378

aaronrothschild opened this issue Oct 2, 2020 · 6 comments · Fixed by #664
Assignees
Labels
Difficulty/3:Hard Hard ticket Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature

Comments

@aaronrothschild
Copy link
Contributor

When a user create a subscription to a repo the plugin should check the repo (or parent Organization for Enterprise) to see if a webhook is in place to deliver the events

If no webhook is found on the GitHub side, an ephemeral post should occur to remind the user that a webhook must be set up. It can then post the url that must be used to deliver the events.

Note that this functionality is already implemented for GitLab and some of this implementation may be salvageable. cc @DHaussermann

@hanzei hanzei added Difficulty/3:Hard Hard ticket Help Wanted Community help wanted Type/Enhancement New feature or improvement of existing feature Up For Grabs Ready for help from the community. Removed when someone volunteers Tech/Go labels Oct 3, 2020
@hanzei
Copy link
Contributor

hanzei commented Oct 3, 2020

One thing to consider while implementing this is which token to use for fetching the information about what webhook to use.

@hanzei
Copy link
Contributor

hanzei commented Jul 15, 2021

Requires #456 to be merged first.

@hanzei
Copy link
Contributor

hanzei commented Jul 15, 2021

The token use to check check the webhook should be the one from the user executing the command. It them doesn't have the appropriate permissions, the check doesn't fail, it just isn't performed.

@mickmister mickmister removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label Jul 22, 2021
@sibasankarnayak
Copy link
Contributor

sibasankarnayak commented Jul 31, 2021

@hanzei just wanted to check

will it be okey if we return the message when the subscription is successful and there is no webhook for repo/owner

Successfully subscribed to mattermost/mattermost-plugin-github ,
can configure the webhook to receive notification [here](https://localhost:8065/admin_console/plugins/plugin_github)

@sibasankarnayak
Copy link
Contributor

@hanzei have implemented this feature in this way , let me know if you have any suggestion from your side

Screenshot 2021-08-02 at 11 39 26 AM

@hanzei
Copy link
Contributor

hanzei commented Feb 20, 2023

#466 can be used as a starting point. This ticket is only about warning the admin that the webhook is missing. /github setup webhook is the command that the admin should be pointed towards.

Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-github that referenced this issue Mar 30, 2023
Kshitij-Katiyar added a commit to Brightscout/mattermost-plugin-github that referenced this issue Apr 4, 2023
…bing' (#28)

* [MI-2935]:Fixed issue mattermost#378 'Check for webhook while subscribing'

* [MI-2935]:Fixed self review comments

* [MI-2935]:Updated the message

* [MI-2935]:Fixed review comments

* [MI-2935]:Fixed lint errors

* [MI-2935]:Fixed review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment