Probot: [Question] Is is possible to redeliver events with probot programatically?

Created on 29 Oct 2019  ·  4Comments  ·  Source: probot/probot

Hey,

we are using probot pretty heavliy.
Currently we deploy our app on kubernetes and the app isn't very stable until now (our fault).
Because of the lacking stability, the app goes down sometimes.
Events delivered while the app is down are lost.
I know, that i can redeliver events from the github web interface.

Now i wanted to ask, if this is possible to redeliver the lost events programatically too, so that i can recover the state of the probot-app.
We save every event to a database, so we could match the redelivered events through the event ids.

I would appreciate any hint in any direction here!

question ❓

Most helpful comment

Ah I see what you mean - in that case, its out of the scope of Probot. You can look into a queuing service like Apache Kafka or RabbitMQ to put in front of your Probot app - the service would receive webhooks and send them to Probot.

I'm going to close this because the solutions are out of scope for this library, but feel free to reopen if you'd like!

All 4 comments

Issue-Label Bot is automatically applying the label question ❓ to this issue, with a confidence of 0.82. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Hey @divramod 👋 There's no built-in way to redeliver webhooks - but, since you're storing them in a database, you can certainly redeliver them yourself. Smee.io has some functionality to redeliver a JSON payload for example; it's effectively the same thing. You'd need to POST to the webhook path of your Probot app, with the same headers as GitHub. As long as the webhook secret is available to the service sending the payload you should be fine. I'd inspect the headers of a POST to see what's what.

You could also leverage probot.receive(), or app.receive(), if you have the JSON object in the same codebase. Hope that helps!

hey @JasonEtco, thx for your fast reply.

i think i wasn't clear enough.
my goal is to redeliver events which haven't been catched by my probot app (because it was down).

By the fact, that my probot app was down, i wasn't able to write them to the database too (writing the events to the database currently happens in the probot app).

But thx for your input. Maybe i could bring up something more stable in front of the probot app, which doesn't crashes or i can find some github api part, which collects all sended events, so that i can access them.

update: i will have a look into this :-) https://developer.github.com/v3/activity/events/

GitHub Developer
Get started with one of our guides, or jump straight into the API documentation.

Ah I see what you mean - in that case, its out of the scope of Probot. You can look into a queuing service like Apache Kafka or RabbitMQ to put in front of your Probot app - the service would receive webhooks and send them to Probot.

I'm going to close this because the solutions are out of scope for this library, but feel free to reopen if you'd like!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GMouron picture GMouron  ·  4Comments

JasonEtco picture JasonEtco  ·  5Comments

zeke picture zeke  ·  4Comments

hiimbex picture hiimbex  ·  4Comments

ericis picture ericis  ·  5Comments