Open mayankmadan opened 5 years ago
@eeshangarg I have made some changes to the content of the message that will be posted when a new page is created. I wanted to get your opinion on it. I was thinking of further formatting 'created_at'. But before doing that I wanted to ask you if the extra information is worth the extra request sent
Can you provide more details on the question about created_at
, maybe with an example + screenshot? Not sure what the product question is.
Can you provide more details on the question about
created_at
, maybe with an example + screenshot? Not sure what the product question is.
@timabbott I'm sorry about that question. At first I somehow missed the 'expand' GET parameter mentioned in the Confluence API's documentation and thought I needed to send a separate request to another endpoint to fetch the author name and 'created_at'. I changed that in the latest commit.
@mayankmadan: This looks good to me. I would recommend addressing my latest comments and once we get a thumbs up from @timabbott, I think we can merge this.
But before we merge it, could you please open a PR that documents this integration in the main repo? That would be great! Thanks! :)
@eeshangarg @timabbott, Right now, the bot needs to be a generic bot as it needs to get the list of streams to which the bot is subscribed to so the updates are sent on those streams. But since the permissions system for bots isnt great right now (on which I really want to work on) I was wondering if this could be made into an incoming webhook bot and the list of streams can be provided in config file
@mayankmadan can you explain precisely why it needs that list? I would imagine there would need to be configuration somewhere determining where in Zulip to send messages from Confluence, but I would imagine we'd just want that to be e.g. a small function in the configuration file that the user writes, not something that involves pulling data from the Zulip server. (A list of subscribed streams, which is what one would get from Zulip, wouldn't encode the mapping the user wants of (Confluence article -> Zulip stream+topic).
Right now, for the bot to function, the user must subscribe it to a stream so the bot knows in which stream to post the updates. The topic inside the stream is just the title of the new page created. Thats why it needs the list of subscribed streams. Also, the stream wouldn't change depending on the Confluence article; only the topic would. So I was thinking to maybe change that so it doesn't have to pull the list of subscribed stream from Zulip API and just provide it the list through the config file.
I think the whole concept of this bot makes it more suitable to be an incoming webhook that can be integrated into the server. It appears that confluence has added support to it in https://jira.atlassian.com/browse/CONFSERVER-52487. But I can't find any relevant documentation for it.
It might be unnecessary to stick with the "subscribe and send messages to subscribed streams" model. I think it should be totally sufficient to have the user hardcode the desired stream to receive notifications for in the config file. We should be able to merge this after tweaking the configuration a little bit and make sure it works with the current version of their REST API.
Fixes: 5142
Made some changes to the original PR by @paras112 Also made the script executable since its a cronjob.
@eeshangarg Can you have a look at it?