-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Add Discourse integration #6201
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
Conversation
roberthoenig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidtaylorhq thank you so much for your work here, great job! For the example chat, maybe we should use a bot that displays the discourse logo. @timabbott apart from a couple little suggestions, this looks ready to merge to me!
zerver/lib/integrations.py
Outdated
| display_name='Desk.com', | ||
| stream_name='desk' | ||
| ), | ||
| WebhookIntegration('discourse', ['communication'], display_name="Discourse"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: single quotes for "Discourse" :)
|
|
||
| {!congrats.md!} | ||
|
|
||
|  |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to use the {!create-stream.md!} macro in the beginning here. The rest is a partial duplicate of create-bot-construct-url.md, but I see why we cannot use that macro here - it contains unfitting instructions.
For the future, maybe we should consider splitting that macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@derAnfaenger it's worth thinking about refactoring that macro for this use case, yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't include the create-stream macro, as there there isn't a requirement to do so. The integration is designed so it can post into any existing stream.
Re. the macros - I started with the create-stream macro but found some stuff wasn't particularly relevent. Is there anything I need to do for the purpose of this PR, or is it ok to leave as-is?
|
@davidtaylorhq this looks pretty good! I think if you fix the little style/text duplication nits, we can merge this. That said, given that the actual formatting is being done on the Discourse side, I wonder if we should instead be defining a "generic" Zulip incoming webhook endpoint that can be used by Discourse/IFTTT/etc. (aka the services that have code for constructing the message formatting on the third party service's side). I see no reason to block merging this on that idea, but @derAnfaenger @eeshangarg @showell what do you think about that idea? Even if we go that route, I'd still want to have documentation on the Zulip side for the individual services we integrate with, but it would allow many integrations of this form to be added without any new code on our end. |
|
Thanks for the comments - will resolve them tomorrow. I 100% agree with the idea of having a "generic" webhook destination for future use. I tried using the |
|
@davidtaylorhq ahh, yes, I think we should actually just changing that endpoint to allow access from incoming webhook bots, which I've just done in . This was on my list of things to check before our first release containing the limited incoming webhook bots in the first place, so thanks for bringing this up :). Do you think it'd be useful to have something more specialized for "incoming webhooks", or does that solve the problem? |
|
I don't think anything more specific is required for my use case - as long as it can take "stream", "subject" and "message" parameters, and authenticate with the api_key then that works great. If this change is live in master, shall I just use that instead? Ideally then we'd have the concept of a "documentation only" integration so that discourse can be listed alongside all the others. |
|
Yeah, it's live in master; why don't you try it out and see how the API feels on your end. I think we already support "documentation-only" integrations in the form of the stuff under |
96e76ae to
9d75bcc
Compare
|
@timabbott I have now changed it to use the I have now updated this PR to remove the webhook integration, and add a 'documentation only' integration. I've updated the screenshot to include the discourse logo as the bot's avatar as-per earlier comments. |
|
|
||
| Head over to the | ||
| [Discourse Chat Integration Setup Instructions](https://meta.discourse.org/t/68501) | ||
| and complete them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular version of Discourse required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No specific version of Discourse - you just need to install the discourse-chat-integration plugin. The details of that are included in the page I've linked to.
|
Looks great; just posted one comment. |
|
Merged, thanks for the contribution @davidtaylorhq! |
|
Great, thanks for the help working everything out 😃 |
This PR adds an integration for Discourse. It links to the discourse-chat-integration plugin.
Details of its use can be found here: https://meta.discourse.org/t/set-up-zulip-notifications-using-the-discourse-chat-integration-plugin/68501
I have followed the "Webhook Walkthrough" from the documentation to create the integration - I hope it is all acceptable. Please do let me know if anything needs to be adjusted 🙂 .