It would be cool to be able to push Phabricator events to Discord.
Description
Revisions and Commits
R44 benzaiten | |||
R44:6dfc7ab4d7a1 Fix T80 and Fix T81 |
Status | Assigned | Task | ||
---|---|---|---|---|
Open | zeigren | T61 Integration Pipe Dream | ||
Open | zeigren | T58 Discord Webhook/Bot |
Event Timeline
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
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.