-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open source @github's Hubot PagerDuty integration #858
Conversation
I'm working on some style updates (ie documentation format) and generalizing... So, plz hold off merging quite yet :) On Mar 29, 2013, at 2:28 PM, Jesse Newland [email protected] wrote:
|
Thanks @technicalpickles 👍 |
So far, I was able to:
The last thing I'd like to see in this is getting rid of the caveat that pagerduty & chat user name has to match. Thereotically, a Another thought is to have a |
@technicalpickles I'm in favor of introducing yourself to hubot for the pagerduty id. It's similar to telling hubot your github name for the Play integration. |
@martinisoft yeah, I think that'll be needed. I would still like to see if we can correctly guess based on a user's name/email what their pagerduty thing is |
What's the status on this, good to merge? |
Not yet, still needs those changes I was talking about to either tell hubot your pagerduty user info, or correctly guess it based on campfire's user. Sent from my iPhone On Apr 4, 2013, at 4:48 PM, Tom Bell [email protected] wrote:
|
I modified hubot to allow adapters to pass more details along with the message, so if that isn't there it should be easy to add without breaking all the things. |
Would love to use this with an irc-based hubot so I'm waiting to see what comes of the "register yourself to hubot so he knows your PD email". Anxiously awaiting final commits. Also available to help if needed. |
I think the best way is attempt to identity you by campfire email else fallback to some manual identification. This means it won't be entirely tied to the campfire adapter. |
For irc (or other systems without a good 1:1 email mapping) I was thinking something like registering your PD email and then save it in the redis brain. I suppose it wouldn't be too hard to include email upon invocation too, something like: "/msg hubot me [email protected] 60" .. ? |
@jnewland was doing more work on this, and got an error like:
Code is: oneHour = now.addHours(1).toISOString() Googling points at datejs. Does that sound right? Need to get that documented. I'm also considering using momentjs instead. |
Yeah, likely. Would like to avoid any external deps if possible. I'll see what I can do here. On Apr 10, 2013, at 7:12 PM, Josh Nichols [email protected] wrote:
|
I think I like the idea of moment, rather than datejs, because it doesn't modify the Date prototype. Actually have a version working with moment already. On Apr 10, 2013, at 7:37 PM, Jesse Newland [email protected] wrote:
|
Sounds legit. On Apr 10, 2013, at 7:44 PM, Josh Nichols [email protected] wrote:
|
Yep yep. Right now, working on going from a message to the pagerduty user, without assuming that usernames are identical. Emails is probably a safer assumption. For campfire, there's like To be continue? On Apr 10, 2013, at 7:45 PM, Jesse Newland [email protected] wrote:
|
@martinisoft I just looked over play.coffee, and don't see anywhere where you introduce yourself to play, or at least it's not using the brain. Checking for other scripts that do something similar. |
@technicalpickles its part of the setup, if you look in this area of play.coffee you'll see the reference to githubLogin. Which comes from github-credentials.coffee |
@martinisoft actually found github-credentials with some clever grepping. Should have something soon... |
* use moment instead of datejs for time manipulation (ie adding hours/minutes) * for `pager me N`, try to use the person who's said it email, instead of their name to find a PagerDuty user * add command to remember your PagerDuty email address * use moment's .calendar() to display nicer time when coverage is * `pager me` will also say what it thinks your PagerDuty email address is
Changes pushed, for anyone wanting to try them! Only things I can think of to consider fixing/updating:
|
I renamed The only question is that
No timezones. I'm guessing it's the TZ of where hubot is running. |
Welcome to dates in JS :P, you can UTC it like |
It's more a display problem. The timezone we get back is in the right timezone, but calendar() doesn't show it. On Apr 11, 2013, at 3:58 AM, Tom Bell [email protected] wrote:
|
Use |
I had contacted pagerduty about adding support for creating notes at some point, and they recently added it, so added support for that here: I also changed the At this point, I think it's 'ready', but like to have some other folks test it on in their hubots first. Particularly @jnewland, so he can use this script directly via hubot-scripts when it's merged. |
This let's us use request_id in places, so when you look at PagerDuty, it reports which user ack/resolved, instead of the logged in user. As part of this, needed to rename HUBOT_PAGERDUTY_APIKEY to HUBOT_PAGERDUTY_SERVICE_API_KEY.
Annnnd, one last change hopefully. I switched to using token authentication. This let's us use requester_id in some places, which means that when you look at incidents on the website, it shows ack/resolve/notes as being from the person who said it in chat, rather than the API user. |
I'll test that out today. |
Man this is badass. |
This has been out for a few hours and gotten good use in the GitHub Ops room. 👍 from me. Thanks for the cleanup @technicalpickles! |
:squirrel: |
Open source @github's Hubot PagerDuty integration
🚨 👑 💥 ✨ |
Released hubot-scripts 2.4.3 with this included. |
Usage
hubot pager help
Config
Some environment variables are required:
Caveats
/pager me 60
assumes your Campfire and PagerDuty usernames are identical.Easter Eggs
major
can be substituted forpager
in most places. Thank Siri for this one.