Page MenuHomePhabricator

Keep Dreaming Project | Discord Webhook/Bot
Open, WishlistPublic

Description

It would be cool to be able to push Phabricator events to Discord.

Revisions and Commits

Event Timeline

zeigren lowered the priority of this task from Needs Triage to Wishlist.Nov 12 2019, 7:38 PM
zeigren created this task.

Using webhooks would be ideal but if not a bot would work. Might already be an alpine linux docker container out there for making a basic Discord bot, otherwise making one wouldn't be difficult.

Technically could use GitHub webhooks for commits but that leaves out all the other useful stuff.

Resources:
https://github.com/shimohq/discord-bot-for-phabricator
https://secure.phabricator.com/book/phabricator/article/webhooks/
https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks
https://discordapp.com/developers/docs/resources/webhook

zeigren renamed this task from Discord Webhook to Discord Webhook/Bot.Nov 12 2019, 7:48 PM

Instead of adding this to Phabricator we could use existing Drone plugins

Altering the Phabricator webhook and sending that to Discord might be the easiest option.

This could be done as a Phabricator extension or library https://secure.phabricator.com/book/phabcontrib/article/adding_new_classes/

Or Phabricator support could be added to something like skyhook
https://github.com/Commit451/skyhook

Of course a more custom solution is always an option, and it could also be used with the Conduit API.
https://docs.python.org/3/library/http.server.html
https://secure.phabricator.com/book/phabricator/article/conduit/
https://github.com/disqus/python-phabricator

I wound up going with a semi-custom solution after getting annoyed with skyhook.

I'm using https://github.com/adnanh/webhook and wrote some scripts for it. All it does is parse the webhook from Phabricator, search for some basic information using the Conduit API, and then push out a basic notification to Discord.

I'd like to actually get it working with skyhook but at the same time my solution fits in a 19MB Docker image and sips 2MB of RAM when idle, so there's that.

I'll leave this open for discussion on further improvements.

I added some upgrades to the webhook which should make any changes easier in the future.

zeigren moved this task from Fix to General on the benzaiten board.

Checkout T61#968 for some extra context.