remind101 / slashdeploy

GitHub Deployments for Slack
https://slashdeploy.io
BSD 2-Clause "Simplified" License
153 stars 20 forks source link

DM user if no deployment starts in X seconds #96

Closed ejholmes closed 6 years ago

ejholmes commented 7 years ago

Sometimes, you might /deploy and nothing happens. There's a few things that could cause this:

  1. The repository doesn't have a webhook configured to handle the deployment event.
  2. The service that handles the deployment event (and subsequently posts back deployment_status events) is broken.
  3. GitHub is down, or otherwise backed up on delivering webhooks

In either case, a simple DM back to the user to let them know that nothing has happened yet, and some helpful steps to debug ("check status.github.com", "does your repo have a webhook to handle github deployments"?)

russellballestrini commented 6 years ago
russellbal [5:49 PM]
How would such a timer work?

ejholmes [5:49 PM]
in Ruby, we'd generally use sidekiq: https://github.com/mperham/sidekiq
GitHub
mperham/sidekiq
sidekiq - Simple, efficient background processing for Ruby

russellbal [5:49 PM]
Ok.

ejholmes [5:49 PM]
enqueue a job to run in the future and check if the deployment is getting processed.

russellbal [5:50 PM]
If it's getting processed exit happy, else alarm

ejholmes [5:50 PM]
yep

russellbal [5:54 PM]
Know off the top of your head how far in the future to enqueue a "check up"? (edited)

ejholmes [5:55 PM]
something reasonable. The happy between creating a deployment, and getting the first `deployment_status` event is probably 1-2 seconds.
I'd say, if nothing starts within 30 seconds, that'd be a pretty good indication that something is wrong.

russellbal [5:56 PM]
nods