stripe-contrib / pagerbot Goto Github PK
View Code? Open in Web Editor NEWManage Pagerduty on-call schedules from within your internal chat channels.
Home Page: https://stripe.com/blog/pagerbot
License: MIT License
Manage Pagerduty on-call schedules from within your internal chat channels.
Home Page: https://stripe.com/blog/pagerbot
License: MIT License
Allowing maintenance mode creation would be a big timesaver, and it would address one of the biggest shortcomings of the Pagerduty mobile app.
all on calls for all schedules? is it possible
right now I can get list of all schedules or people, can I get list of all schedules with on call person
Hi Awesome,
I'm using your application and I really like it. Just one more thing to make it perfect to me is create a incident on pagerduty, I don't see it on your manual page.
Do you have plan to do that ?
I really appreciate your efforts
Looking forward to hearing from you
A common use case for other chatbots (as well as manually triggering incidents from the PD app or API) is to page the on-call for a given team.
It would be great if this tool could do that as well, probably by creating a page- service for each EP in the account. As a bonus, since every service is owned by a single escalation policy, you would not have to use the temporary-override workaround.
A nice-to-have would be the ability to alias escalation policy names as well.
We're seeing periodic disconnects in SlackRTMAdapter
after a few hours. The maximum duration of a slack RTM session is 8 hours, so I figure it's that: https://api.slack.com/events/goodbye
I figure the right thing to do here is to reconnect, but I don't see logic for that. Is there a prescribed solution to this that I'm missing?
When I get
someone it appears to put that person on duty for 5 minutes. Here is what I did:
[11:17 AM] John Dyer: pagerbot: get jake because we need to test something
[11:17 AM] pagerbot BOT: Contacted Jake Herbst, see the incident created here.
and at the time I was on duty and Jake was paged but it also put him on duty for five minutes. Is this expected?
-John
We have only one PagerDuty schedule defined called "Normal"
Resulting in:
cboscolo [9:38 AM] pagerbot when is cboscolo on call
pagerbotBOT [9:38 AM] CBoscolo is not scheduled to go on any schedule
But if I reference our schedule by name it works.
cboscolo [9:39 AM] pagerbot when is cboscolo on Normal
pagerbotBOT [9:39 AM] CBoscolo goes on call at 5:00 PM Feb 10 (-0800) for schedule Normal
This was tested after updating to: 736a89c
We just pushed a fork with support for deploying to kubernetes.
Let me know if this is a PR you are interested in. We further updated to a ruby 2.5 docker image and some other small stuff.
Anyone with some design experience, feel free to reach out!
On Slack, the bot doesn't answer any command made to the @
version, even though #9 tells me it's supposed to:
astorije
@pagerbot put me on oncall for next 30 minutes
astorije
pagerbot put me on oncall for next 30 minutes
pagerbot
Ok. Put ... on ... from 1:08 PM May 4 (-0400) until 1:38 PM May 4 (-0400).
Currently pagerbot offers you a way to page a user or schedule directly. As all alarms have a direct mapping to a service, does it make sense to extend the functionality to page a service?
I'm also curious behind the use case for paging a schedule but not a service ๐
I followed the dev instructions on OSX sierra, using brew install mongo
to get v3.4.1. I get the following failure when trying to go through setup:
2017-01-10 16:52:40 - Mongo::OperationFailure - Database command 'update' failed: Unknown option to update command: upsert:
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/db.rb:610:in `rescue in command'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/db.rb:606:in `command'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:314:in `block in send_write_command'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:55:in `block in instrument'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:20:in `instrument'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/functional/logging.rb:54:in `instrument'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/collection_writer.rb:313:in `send_write_command'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/collection.rb:1104:in `send_write'
/Users/xavier/.gem/ruby/2.3.1/gems/mongo-1.12.5/lib/mongo/collection.rb:497:in `update'
/Users/xavier/Development/pagerbot/lib/admin/admin_server.rb:77:in `block in <class:AdminPage>'
This is confusing since 3.4.1 version of mongo definitely supports this command. In prod (on heroku) I'm running 3.2.11, so maybe that's a problem. I guess I can go and find an older version to install.
I noticed that version of the mongo gem is way behind head (2.4.1
), so tried upgrading it. That causes other errors โ I can try working through them to fix if someone thinks that would help. I can't find a changelog for that gem though.
So I have some more things I can try but before I go chasing rabbits wanted to check if anyone else seen this or have some likely hypotheses as to the problem?
Did you mean X
type message would be really helpful.
In the function post
inside pagerduty.rb
there are references to the variables options
and answer
, but these are nowhere instantiated. The variable names should be opts
and json_response
respectively.
Hello,
It is not clear what you guys expect for the call_person
resource. What needs to be setup on Pagerduty, for example the service_id, what do you expect setup there. ?
Thanks
-John
I set up a temp service, escalation policy, and schedule for use by pagerbot. I tested it, which put me on call for 5m, and it worked. Much later, I did @pagerbot get someone_else whatever
, and I got a notification from pagerduty that I was going on call, and then right after, I got the going off call notification. The incident that it created did get assigned to the someone else.
Is this a known thing?
When I added my full access v2 pagerduty key, the admin console said that it was connected to pagerduty but when I start up pagerbot, it never gets any users or schedules. I have tried many ideas to figure this out but I am stuck. Any help would be greatly appreciated!
For a little more context, this is in the logs when I deploy the app:
:users=>[], :schedules=>[]
When I run the curl command from the PagerDuty api, I get a list of all users and schedules, so I know the key is working. Also, after throwing some debugging messages in, I am seeing expected payloads coming back from PagerDuty.
Update: While trying to figure this out, I remembered that my admin console was acting kind of wonky. The user and schedule alias sections won't open. I get a 500 back when I try to click on them.
I just found that the Total attribute, in the payload coming back from PagerDuty, is null.
I'm trying this out for our slack/pagerduty integration project.
I've managed to get it to listen on 0.0.0.0 but it doesn't appear to be taking in data from slack (although I am seeing requests from AWS, which would be where slack is hosted):
The below shows be attempting to set it as an environment variable.
$ su pagerbot -c 'export DEPLOYED=true; cd /home/pagerbot; bundle exec ruby lib/pagerbot.rb admin slack'
INFO lib/pagerbot.rb:97:in `
I also tried adding the file 'config' mentioned in pagerbot.rb, but my exposure to ruby is pretty much limited to using puppet...
Thanks,
Loving Pagerbot! It seems as if it doesn't work in private groups within slack. Is this by design or did I miss something on the config side?
Its not clear what type of API token you require. The link on the home page does not appear to link to a specifics type. It would be great if you could clarify which token you require. Thanks
Deployed pagerbot using "Deploy to Heroku" button.
Issuing the following:
cboscolo [1:03 PM] pagerbot: when is andrew. on call
Results in:
pagerbot [1:03 PM] Hmm, that didn't seem to work: undefined method
[]' for nil:NilClass`
Everything else appears to work fine. For example, if I use the name of the schedule it works:
cboscolo [1:04 PM] pagerbot: when is andrew on normal
Results in:
pagerbot [1:04 PM] Andrew is not scheduled to go on Normal.
The field is in the data structures, but is not currently exposed in any way.
Logs:
$ git push heroku master
Enumerating objects: 983, done.
Counting objects: 100% (983/983), done.
Delta compression using up to 8 threads
Compressing objects: 100% (432/432), done.
Writing objects: 100% (983/983), 842.94 KiB | 140.49 MiB/s, done.
Total 983 (delta 528), reused 983 (delta 528)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rack
remote: -----> Using Ruby version: ruby-2.5.3
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: fatal: not a git repository (or any parent up to mount point /)
remote: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
remote: Fetching gem metadata from https://rubygems.org/........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Fetching i18n 0.8.0
remote: Fetching minitest 4.7.5
remote: Fetching multi_json 1.12.1
remote: Installing multi_json 1.12.1
remote: Installing minitest 4.7.5
remote: Installing i18n 0.8.0
remote: Fetching thread_safe 0.3.5
remote: Fetching tzinfo 0.3.52
remote: Installing thread_safe 0.3.5
remote: Installing tzinfo 0.3.52
remote: Fetching bson 4.2.1
remote: Installing bson 4.2.1 with native extensions
remote: Fetching bson_ext 1.5.1
remote: Installing bson_ext 1.5.1 with native extensions
remote: Using bundler 1.15.2
remote: Fetching chronic 0.10.2
remote: Installing chronic 0.10.2
remote: Fetching numerizer 0.1.1
remote: Installing numerizer 0.1.1
remote: Fetching cinch 2.3.3
remote: Installing cinch 2.3.3
remote: Fetching concurrent-ruby 1.0.4
remote: Installing concurrent-ruby 1.0.4
remote: Fetching configatron 4.5.0
remote: Installing configatron 4.5.0
remote: Fetching daemons 1.2.4
remote: Installing daemons 1.2.4
remote: Fetching unf_ext 0.0.7.2
remote: Installing unf_ext 0.0.7.2 with native extensions
remote: Fetching eventmachine 1.2.2
remote: Installing eventmachine 1.2.2 with native extensions
remote: Fetching multipart-post 2.0.0
remote: Installing multipart-post 2.0.0
remote: Fetching websocket-extensions 0.1.2
remote: Installing websocket-extensions 0.1.2
remote: Fetching gli 2.15.0
remote: Installing gli 2.15.0
remote: Fetching hashie 3.5.1
remote: Installing hashie 3.5.1
remote: Fetching json 2.0.3
remote: Installing json 2.0.3 with native extensions
remote: Fetching mime-types-data 3.2016.0521
remote: Installing mime-types-data 3.2016.0521
remote: Fetching netrc 0.11.0
remote: Installing netrc 0.11.0
remote: Fetching method_decorators 0.9.6
remote: Installing method_decorators 0.9.6
remote: Fetching rack 1.6.5
remote: Installing rack 1.6.5
remote: Fetching tilt 2.0.6
remote: Installing tilt 2.0.6
remote: Fetching activesupport 4.0.13
remote: Installing activesupport 4.0.13
remote: Fetching chronic_duration 0.10.6
remote: Installing chronic_duration 0.10.6
remote: Fetching semantic_logger 3.4.1
remote: Installing semantic_logger 3.4.1
remote: Fetching mongo 2.4.1
remote: Installing mongo 2.4.1
remote: Fetching faraday 0.11.0
remote: Installing faraday 0.11.0
remote: Fetching websocket-driver 0.6.5
remote: Installing websocket-driver 0.6.5 with native extensions
remote: Fetching unf 0.1.4
remote: Installing unf 0.1.4
remote: Fetching mime-types 3.1
remote: Installing mime-types 3.1
remote: Fetching rack-protection 1.5.3
remote: Installing rack-protection 1.5.3
remote: Fetching faraday_middleware 0.11.0.1
remote: Installing faraday_middleware 0.11.0.1
remote: Fetching domain_name 0.5.20161129
remote: Installing domain_name 0.5.20161129
remote: Fetching sinatra 1.4.8
remote: Installing sinatra 1.4.8
remote: Fetching http-cookie 1.0.3
remote: Installing http-cookie 1.0.3
remote: Fetching rest-client 2.0.0
remote: Installing rest-client 2.0.0
remote: Fetching mailgun-ruby 1.1.2
remote: Installing mailgun-ruby 1.1.2
remote: Fetching faye-websocket 0.10.6
remote: Fetching thin 1.7.0
remote: Installing thin 1.7.0 with native extensions
remote: Installing faye-websocket 0.10.6
remote: Fetching slack-ruby-client 0.7.9
remote: Installing slack-ruby-client 0.7.9
remote: Using pagerbot 0.3.0 from source at `.`
remote: Bundle complete! 9 Gemfile dependencies, 45 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (32.88s)
remote: Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: Could not detect rake tasks
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: /tmp/build_516621b0dcb6ff90cc1e17d94c4bc75e/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:284:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
remote: from /tmp/build_516621b0dcb6ff90cc1e17d94c4bc75e/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems.rb:303:in `activate_bin_path'
remote: from /tmp/build_516621b0dcb6ff90cc1e17d94c4bc75e/vendor/ruby-2.5.3/bin/rake:29:in `<main>'
remote:
remote: ###### WARNING:
remote:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.5.3'
remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> bot, web
remote: Default types for buildpack -> console, rake
remote:
remote: -----> Compressing...
remote: Done: 21.3M
remote: -----> Launching...
remote: Released v8
remote: https://tranquil-stream-69081.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
Used deploy to Heroku, saw segfaults in my logs. Deeper inspection showed an older version of the activesupport
package causing it.
This was my solution: PR #67
Is there a way to do this (even if it's console hax)?
Not a big deal, just setting this up and churning a bit getting everything just right.
Thanks so much for this project! Looks like exactly what my team needs.
This might be a n00b kind of problem, but I'm unable to get my Slackbot to come online.
I used the Heroku install. Here's what I did so far:
Set up PagerDuty:
Set up Slack:
Set up plugins (I only enabled the ones that didn't require inputs for now):
Deployed by switching off the web app and switching on the bot app.
I can see the bot in Slack but it won't come online:
Here are the logs when I start up the bot:
Feb 09 08:58:01 test-pagerbot heroku/router: at=error code=H14 desc="No web processes running" method=GET path="/api/bot" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:02 test-pagerbot heroku/router: at=error code=H14 desc="No web processes running" method=GET path="/views/bot.html" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:07 test-pagerbot heroku/router: at=error code=H14 desc="No web processes running" method=GET path="/" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:16 test-pagerbot app/api: Scaled to bot@1:Free console@0:Free rake@0:Free web@1:Free by user [email protected]
Feb 09 08:58:17 test-pagerbot heroku/bot.1: State changed from crashed to down
Feb 09 08:58:18 test-pagerbot app/api: Scaled to bot@0:Free console@0:Free rake@0:Free web@1:Free by user [email protected]
Feb 09 08:58:18 test-pagerbot heroku/web.1: Starting process with command `bundle exec ruby lib/pagerbot.rb web`
Feb 09 08:58:20 test-pagerbot app/web.1: fatal: Not a git repository (or any parent up to mount point /app)
Feb 09 08:58:20 test-pagerbot app/web.1: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Feb 09 08:58:21 test-pagerbot app/web.1: 2017-02-09 16:58:20.898531 I [4:70187052317060] PagerBot -- Starting application -- {:is_admin=>true, :argv=>["web"]}
Feb 09 08:58:21 test-pagerbot app/web.1: == Sinatra (v1.4.8) has taken the stage on 56160 for production with backup from Thin
Feb 09 08:58:21 test-pagerbot heroku/web.1: State changed from starting to up
Feb 09 08:58:22 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:22 +0000] "GET / HTTP/1.1" 200 3634 0.0066
Feb 09 08:58:22 test-pagerbot heroku/router: at=info method=GET path="/" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:22 test-pagerbot heroku/router: at=info method=GET path="/api/bot" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:23 test-pagerbot heroku/router: at=info method=GET path="/views/bot.html" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:23 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:22 +0000] "GET /views/bot.html HTTP/1.1" 200 5226 0.0016
Feb 09 08:58:23 test-pagerbot heroku/router: at=info method=GET path="/api/bot" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:23 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:22 +0000] "GET /api/bot HTTP/1.1" 200 225 0.0421
Feb 09 08:58:23 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:22 +0000] "GET /api/bot HTTP/1.1" 200 225 0.0289
Feb 09 08:58:23 test-pagerbot heroku/router: at=info method=GET path="/api/pagerduty" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:23 test-pagerbot app/web.1: 2017-02-09 16:58:23.123269 I [4:70187065891660] (592.9ms) PagerBot::AdminPage -- Checking pagerduty connectivity.
Feb 09 08:58:23 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:23 +0000] "GET /api/pagerduty HTTP/1.1" 200 93 0.6625
Feb 09 08:58:27 test-pagerbot heroku/router: at=info method=POST path="/api/bot" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:28 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:27 +0000] "POST /api/bot HTTP/1.1" 200 235 0.0285
Feb 09 08:58:30 test-pagerbot heroku/router: at=info method=GET path="/api/plugins" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:30 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:30 +0000] "GET /api/plugins HTTP/1.1" 200 1994 0.0637
Feb 09 08:58:33 test-pagerbot heroku/router: at=info method=GET path="/api/users" host=xxxxxxxxxx.herokuapp.com request_id=xxxxxxxxxxxxxxxx
Feb 09 08:58:33 test-pagerbot app/web.1: 2017-02-09 16:58:32.930503 I [4:70187065890220] (533.7ms) PagerBot::DataStore -- Fetching collection from pagerduty.
Feb 09 08:58:33 test-pagerbot app/web.1: 2017-02-09 16:58:32.930681 I [4:70187065890220] PagerBot::DataStore -- Added to users: []
Feb 09 08:58:33 test-pagerbot app/web.1: 2017-02-09 16:58:32.932656 I [4:70187065890220] PagerBot::DataStore -- Removed from users: []
Feb 09 08:58:33 test-pagerbot app/web.1: 2017-02-09 16:58:32.937218 I [4:70187065890220] PagerBot::DataStore -- Refreshed collection. -- {:collection_name=>"users", :total=>8, :added=>0, :removed=>0}
Feb 09 08:58:33 test-pagerbot app/web.1: 216.207.42.140 - - [09/Feb/2017:16:58:32 +0000] "GET /api/users HTTP/1.1" 200 10615 0.5806
Feb 09 08:59:10 test-pagerbot app/api: Scaled to bot@1:Free console@0:Free rake@0:Free web@1:Free by user [email protected]
Feb 09 08:59:12 test-pagerbot heroku/bot.1: Starting process with command `bundle exec ruby lib/pagerbot.rb`
Feb 09 08:59:13 test-pagerbot heroku/bot.1: State changed from starting to up
Feb 09 08:59:15 test-pagerbot app/bot.1: fatal: Not a git repository (or any parent up to mount point /app)
Feb 09 08:59:15 test-pagerbot app/bot.1: Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Feb 09 08:59:16 test-pagerbot app/bot.1: 2017-02-09 16:59:15.911067 I [4:70183564769660] PagerBot -- Starting application -- {:is_admin=>false, :argv=>[]}
Feb 09 08:59:16 test-pagerbot app/bot.1: 2017-02-09 16:59:15.988586 I [4:70183564769660] PagerBot::PluginManager -- Loading plugin. -- {:name=>"add_alias", :class=>"PagerBot::Plugins::AddAlias", :config=>{}}
Feb 09 08:59:16 test-pagerbot app/bot.1: 2017-02-09 16:59:15.989743 I [4:70183564769660] PagerBot::PluginManager -- Loading plugin. -- {:name=>"reload", :class=>"PagerBot::Plugins::Reload", :config=>{}}
Feb 09 08:59:16 test-pagerbot app/bot.1: 2017-02-09 16:59:15.990276 I [4:70183564769660] PagerBot::PluginManager -- Loading plugin. -- {:name=>"schedule_override", :class=>"PagerBot::Plugins::ScheduleOverride", :config=>{}}
Feb 09 08:59:16 test-pagerbot app/bot.1: 2017-02-09 16:59:15.991089 I [4:70183564769660] PagerBot::PluginManager -- Loading plugin. -- {:name=>"switch_shift", :class=>"PagerBot::Plugins::SwitchShift", :config=>{}}
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.459558 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.463755 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.466233 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.538811 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.540161 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Feb 09 08:59:23 test-pagerbot app/bot.1: W, [2017-02-09T16:59:22.542076 #4] WARN -- : You are setting a key that conflicts with a built-in method Slack::Messages::Message#presence defined at /app/vendor/bundle/ruby/2.2.0/gems/slack-ruby-client-0.7.8/lib/slack/messages/message.rb:4. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
Hopefully I'm just doing something silly. Thanks again for your work on this!
Right now, the following commands won't work
@pagerbot manual
They should work.
Right now the syntaxes are:
911 TEAM [MESSAGE]
get PERSON [subject SUBJECT]
My vote would be to drop "subject" from "get" since I think that's the more natural thing for people to type.
For bonus points, make "subject" optional for both (but don't list it in help) in case people still use it.
For even more bonus points, make either command work for teams or people although, again, get rid of one from help. So help would only list get <TEAM | PERSON> [MESSAGE]
but any of these would work:
pagerbot: 911 sys
pagerbot: get sys the site's down
pagerbot: 911 dbenamy subject unicorns are attacking
What do you think?
Whenever I try the "list" or "people" commands in slack, the bot says "Hmm, that didn't seem to work: No such file or directory @ rb_sysopen - /app/templates/list_irc.erb". I can see the Users and Schedules in the Pagerbot setup under the "User Aliases" and "Schedule Aliases" tabs though
this would be great
Make any request via slack adapter. The following is put into logs:
2017-01-23T19:00:28.900703+00:00 app[web.1]: INFO /app/lib/pagerbot/slack_adapter.rb:55:in `block in <class:SlackAdapter>': {:token=>"REDACTED", :nick=>"xavier", :channel_name=>"testing", :text=>"pagerbot help", :user_id=>"REDACTED", :adapter=>:slack}
... except they're not actually REDACTED, I edited that in. For user_id
that's probably not sensitive. I'm fairly certain the slack token is though and so shouldn't be ending up in logs.
We'd like to be able to deploy this from scratch with the configuration working, is it possible to do this with curl against the admin API currently?
It would be great if we could provide json or yaml as a configuration file instead though.
This seems not to work and I don't see the code at a quick skim but want to make sure I'm not missing something. If not, that'd be a nice thing to add :-)
csmith [11:08 AM] pagerbot put me on weekly noc schedule during ddouglas's shift on August 13th
pagerbot [11:08 AM]
Hmm, that didn't seem to work: Problem talking to PagerDuty: 404 Not Found
Request was GET /schedules/[redacted]/entries?{:since=>"2017-08-13T00:00:00-04:00", :until=>"2017-08-13T23:59:59-04:00", :overflow=>true}
Syntax: put PERSON on SCHEDULE during ANOTHERPERSON's shift on DAY
I have confirmed ddouglas does have a shift on weekly noc schedule on august 13th, it seems it may be having trouble finding the shift or something? Is there more verbose logging I can enable?
Thanks!
By default after standing up the app on Heroku, I don't seem to be able to add a channel for the Slack config.
/bot doesn't seem to be returning the bot_defaults
Instead, it only seems to return {}
at the outset, and then once saved, name and adapter: {"name":"","adapter":"slack"}
This leads to the following Angular error when trying to add a channel:
TypeError: Cannot read property 'push' of undefined
at k.$scope.add_channel (bot-setup.js:29)
at angular.js:10821
at angular.js:19062
at k.$eval (angular.js:12658)
at k.$apply (angular.js:12756)
at HTMLAnchorElement.<anonymous> (angular.js:19061)
at HTMLAnchorElement.n.event.dispatch (jquery-1.11.0.min.js:3)
at HTMLAnchorElement.r.handle (jquery-1.11.0.min.js:3)
Screenshot: http://cl.ly/image/0B0t0n3f1j2d
I worked around this by using Curl to post the proper bot-defaults to the /bot endpoint:
curl -X POST -d "{\"name\":\"pagerbot\",\"channels\":[\"general\"],\"adapter\":\"slack\",\"irc\":{\"server\":\"irc.freenode.org\",\"port\":6697,\"use_ssl\":false},\"slack\":{\"emoji\":\":frog:\"},\"hipchat\":{}}" "http://app.url/bot" -H "Content-Type: application/json"
I was able to reproduce this issue by tearing down my MongoDB instance and setting it up again - same issue happened.
Slack users are accustomed to using @
mentions. For example:
@pagerbot put @wookasz on primary for 23h
However, this results in an error. Stripping the @
prefix from username tokens should solve the problem for many users.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.