voltron-defender 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e7cf7bed8a5c60c7cc41aa090e7f454a08b2617c
4
+ data.tar.gz: b06dd07931a378149bf1c4db962c7f2382d871c6
5
+ SHA512:
6
+ metadata.gz: acaa9c19c64a89f11bdec77c0c0035c0454aaefc64b750257a2592a80fb6dcc2438e9160907f1ebfaf85efe833be151fed71a056ecfbf5eca66b904b20aee9cd
7
+ data.tar.gz: b02a90da721bc4db78a9ad1d55152e82066de8f057e607ecba73cfd2346312ead925f8b1289df3c38219d388942d0a3f83df2433de1b519d09c306ec313f0000
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.1
5
+ before_install: gem install bundler -v 1.12.5
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at eric.hainer@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+ source 'https://gem.minow.io'
3
+
4
+ # Specify your gem's dependencies in voltron-rack.gemspec
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Eric Hainer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Voltron::Rack
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/voltron/rack`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'voltron-rack'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install voltron-rack
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/voltron-rack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,29 @@
1
+ module Voltron
2
+ class Defender
3
+ class Error < ActiveRecord::Base
4
+
5
+ self.table_name = 'voltron_defender_errors'
6
+
7
+ def name
8
+ "Exception ##{id}"
9
+ end
10
+
11
+ def message
12
+ output = []
13
+ output << "*Message:* #{::Slack::Messages::Formatting.unescape(error)}"
14
+ output << "*File:* #{::Slack::Messages::Formatting.unescape(file)}"
15
+ output << "*Line:* #{::Slack::Messages::Formatting.unescape(line)}"
16
+ output.join("\n")
17
+ end
18
+
19
+ def http_headers
20
+ JSON.parse(headers) rescue {}
21
+ end
22
+
23
+ def in_trello?
24
+ status == 'trello'
25
+ end
26
+
27
+ end
28
+ end
29
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "voltron/rack"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,14 @@
1
+ class CreateVoltronDefenderErrors < ActiveRecord::Migration
2
+ def change
3
+ create_table :voltron_defender_errors do |t|
4
+ t.string :status
5
+ t.string :error
6
+ t.string :file
7
+ t.string :line
8
+ t.text :trace
9
+ t.text :headers
10
+
11
+ t.timestamps null: false
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,92 @@
1
+ module Voltron
2
+ class Defender
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+
6
+ source_root File.expand_path("../../../templates", __FILE__)
7
+
8
+ desc "Add Voltron Defender initializer"
9
+
10
+ def inject_initializer
11
+
12
+ voltron_initialzer_path = Rails.root.join('config', 'initializers', 'voltron.rb')
13
+
14
+ unless File.exist? voltron_initialzer_path
15
+ unless system("cd #{Rails.root.to_s} && rails generate voltron:install")
16
+ puts "Voltron initializer does not exist. Please ensure you have the 'voltron' gem installed and run `rails g voltron:install` to create it"
17
+ return false
18
+ end
19
+ end
20
+
21
+ current_initiailzer = File.read voltron_initialzer_path
22
+
23
+ unless current_initiailzer.match(Regexp.new(/# === Voltron Defender Configuration ===/))
24
+ inject_into_file(voltron_initialzer_path, after: "Voltron.setup do |config|\n") do
25
+ <<-CONTENT
26
+
27
+ # === Voltron Defender Configuration ===
28
+
29
+ # Whether or not to enable Slack/Trello integration
30
+ # IP restricted detailed error pages are not affected by this setting
31
+ config.defender.enabled = false
32
+
33
+ # Slack API token
34
+ config.defender.slack_api_token = ''
35
+
36
+ # The Slack channel name in which to report exceptions
37
+ config.defender.slack_channel = ''
38
+
39
+ # Trello API key
40
+ config.defender.trello_key = ''
41
+
42
+ # Trello API token
43
+ config.defender.trello_token = ''
44
+
45
+ # Whether or not to allow showing error details based on IP address
46
+ # If false, the value of Rails.application.config.consider_all_requests_local
47
+ # and the corresponding behavior will always be respected
48
+ config.defender.ip_restrict_errors = true
49
+
50
+ # An array of IP addresses or Regexp objects to compare to the REMOTE_ADDR
51
+ # value to determine whether or not to show detailed error messages
52
+ config.defender.ips = []
53
+ CONTENT
54
+ end
55
+ end
56
+ end
57
+
58
+ def copy_migrations
59
+ copy_migration "create_voltron_defender_errors"
60
+ end
61
+
62
+ protected
63
+
64
+ def copy_migration(filename)
65
+ if migration_exists?(Rails.root.join("db", "migrate"), filename)
66
+ say_status("skipped", "Migration #{filename}.rb already exists")
67
+ else
68
+ copy_file "db/migrate/#{filename}.rb", Rails.root.join("db", "migrate", "#{migration_number}_#{filename}.rb")
69
+ end
70
+ end
71
+
72
+ def migration_exists?(dirname, filename)
73
+ Dir.glob("#{dirname}/[0-9]*_*.rb").grep(/\d+_#{filename}.rb$/).first
74
+ end
75
+
76
+ def migration_id_exists?(dirname, id)
77
+ Dir.glob("#{dirname}/#{id}*").length > 0
78
+ end
79
+
80
+ def migration_number
81
+ @migration_number ||= Time.now.strftime("%Y%m%d%H%M%S").to_i
82
+
83
+ while migration_id_exists?(Rails.root.join("db", "migrate"), @migration_number) do
84
+ @migration_number += 1
85
+ end
86
+
87
+ @migration_number
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,40 @@
1
+ module Voltron
2
+ class Config
3
+
4
+ def defender
5
+ @defender ||= Defender.new
6
+ end
7
+
8
+ class Defender
9
+
10
+ attr_accessor :enabled, :slack_api_token, :slack_channel, :trello_key, :trello_token, :trello_board, :ip_restrict_errors, :ips
11
+
12
+ def initialize
13
+ @enabled ||= false
14
+ @ip_restrict_errors ||= true
15
+ @ips ||= []
16
+ end
17
+
18
+ def enabled?
19
+ enabled == true
20
+ end
21
+
22
+ def has_ip?(ip)
23
+ return false if ip.blank?
24
+
25
+ candidates = [ips].flatten.compact
26
+
27
+ candidates.each do |candidate|
28
+ if candidate.is_a?(Regexp)
29
+ return true if candidate =~ ip.to_s
30
+ else
31
+ return true if candidate.to_s == ip.to_s
32
+ end
33
+ end
34
+
35
+ false
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,70 @@
1
+ require 'voltron'
2
+ require 'tempfile'
3
+ require 'voltron/defender/version'
4
+ require 'voltron/config/defender'
5
+ require 'voltron/defender/slack_adapter'
6
+ require 'voltron/defender/trello_adapter'
7
+ require 'voltron/defender/commands/when'
8
+ require 'voltron/defender/commands/trace'
9
+ require 'voltron/defender/commands/http'
10
+ require 'voltron/defender/commands/trello'
11
+ require 'voltron/defender/commands/help'
12
+ require 'voltron/defender/commands/stop'
13
+ require 'voltron/defender/commands/defender'
14
+
15
+ module Voltron
16
+ class Defender
17
+
18
+ def initialize(app)
19
+ @app = app
20
+
21
+ @slack = ::Voltron::Defender::SlackAdapter.new
22
+
23
+ @slack.commander.listen_to(::Voltron::Defender::When)
24
+ @slack.commander.listen_to(::Voltron::Defender::Trace)
25
+ @slack.commander.listen_to(::Voltron::Defender::Http)
26
+ @slack.commander.listen_to(::Voltron::Defender::Trello)
27
+ @slack.commander.listen_to(::Voltron::Defender::Stop)
28
+ @slack.commander.listen_to(::Voltron::Defender::Help)
29
+ @slack.commander.listen_to(::Voltron::Defender::Defender)
30
+ end
31
+
32
+ def call(env)
33
+ begin
34
+ @app.call(env)
35
+ rescue Exception => e
36
+ if Voltron.config.defender.enabled?
37
+ error = Voltron::Defender::Error.new(exception_params(e, env))
38
+ handle(error) if error.save
39
+ end
40
+
41
+ if Voltron.config.defender.ip_restrict_errors
42
+ if Voltron.config.defender.has_ip?(env.try(:[], 'REMOTE_ADDR'))
43
+ env['action_dispatch.show_detailed_exceptions'] = true
44
+ end
45
+ end
46
+ raise e
47
+ end
48
+ end
49
+
50
+ def handle(error)
51
+ @slack.client.start_async unless @slack.client.started?
52
+
53
+ if @slack.client.started?
54
+ @slack.attach(error.name, error.message, :danger)
55
+ end
56
+ end
57
+
58
+ private
59
+
60
+ def exception_params(ex, env)
61
+ last_line = (ex.backtrace.first || 'Unknown:Unknown').split(':')
62
+ headers = (env ||= {}).select { |k,v| /^[A-Z_]+$/.match(k.to_s) }
63
+
64
+ { error: ex.message, file: last_line[0], line: last_line[1], trace: ex.backtrace.join("\n"), headers: headers.to_json }
65
+ end
66
+
67
+ end
68
+ end
69
+
70
+ require "voltron/defender/engine" if defined?(Rails)
@@ -0,0 +1,47 @@
1
+ module Voltron
2
+ class Defender
3
+ class Command
4
+
5
+ attr_accessor :input
6
+
7
+ def parse(text)
8
+ text.downcase!
9
+ @input = /^\.(?<command>[a-z]+)\s*(?<id>[0-9]+)*\s*(?<args>.*)/.match(text) || {}
10
+ end
11
+
12
+ def matches?(text)
13
+ parse(text)
14
+ Array.wrap(responds_to).include?(command)
15
+ end
16
+
17
+ def error
18
+ if ::Voltron::Defender::Error.exists?(id)
19
+ ::Voltron::Defender::Error.find(id)
20
+ elsif ::Voltron::Defender::Error.count > 0
21
+ ::Voltron::Defender::Error.last
22
+ else
23
+ false
24
+ end
25
+ end
26
+
27
+ def command
28
+ @input[:command].to_s
29
+ end
30
+
31
+ def id
32
+ @input[:id].to_i
33
+ end
34
+
35
+ def args
36
+ @input[:args].to_s.split(/\s+/)
37
+ end
38
+
39
+ def answer(text, adapter)
40
+ end
41
+
42
+ def help
43
+ end
44
+
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,29 @@
1
+ module Voltron
2
+ class Defender
3
+ class Commander
4
+
5
+ def initialize
6
+ @listeners = []
7
+ end
8
+
9
+ def matches?(text)
10
+ processor(text).present?
11
+ end
12
+
13
+ def processor(text)
14
+ @listeners.find do |listener|
15
+ listener.matches?(text)
16
+ end
17
+ end
18
+
19
+ def listeners
20
+ @listeners || []
21
+ end
22
+
23
+ def listen_to(klass)
24
+ @listeners << klass.new
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,18 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Defender < Command
6
+
7
+ def responds_to
8
+ ['defender']
9
+ end
10
+
11
+ def respond_with(adapter)
12
+ output = "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMNdMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMdNMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMm+.-MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM..+mMMMMMMMMMMMMM\nMMMMMMMMMMMMm`---MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.--`mMMMMMMMMMMMM\nMMMMMMMMMMMMh ...mMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMm`.. hMMMMMMMMMMMM\nMMMMMMMMMMMM:.--`sMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMo`--.:MMMMMMMMMMMM\nMMMMMMMMMMMM:.--.oMMMMMMmhhhhhhhho/ooooo/ohhhhhhhhmMMMMMMo.--.:MMMMMMMMMMMM\nMMMMMMMMMMMM:.--.oMMMMMy.--------.:MMMMM-.--------.oNMMMMo.--.:MMMMMMMMMMMM\nMMMMMMMMMMMM:.---.odmd/..::::::::-yNNNNNy-::::::::..:dmdo.---.:MMMMMMMMMMMM\nMMMMMMMMMMMMh:.-------..sNNNNNNNNNMhhhhhNNNNNNNNNNh-.-------.:hMMMMMMMMMMMM\nMMMMMMMMMMMMMNd/..---.-dMMMMMMMMMMNyyyyymMMMMMMMMMMN/.---..+dNMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMm+`-.:NMMMMMMMMMMMmhhhhhdMMMMMMMMMMMMo`-`/mMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMm`--./MMMsydmNNMMMMNNNNNMMMMNNmmhomMMh`--`yMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMM/.:smMMMh+/+++odMMMMMMMMMMoo++/+oMMMNh/..NMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMM.hNMMMMMMNmdhyshMMMMMMMMMNosyhdmNMMMMMMm-dMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMM-dMNmMMmddhhysooMMMMMMMMMdosyhhddmMMdmMM`NMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMM/yNooMM+` mMMMMMMMM+ `+MMoodN`MMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMooNoodMm-` ymdNMNmdM- `-NMmoomd-MMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMy:Mo+sMMNho+/:-.smhhhhyhM--:/+oo/mMh++my/MMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMm.MsoomMMN...-:/+yhmmmdyo/:-.`` .MMsooMooMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMM`Ny++hMMMo `:No. `oMN++oM:yMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMs/msooNyMdo/:-...shdhh:`..-:+odyMyooms/NMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMy/dsodyyymooooohNdhhmNooooohydoNooho+NMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMh:msoN-mMMhysomMh//smssyyydM:msom++MMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMh:dsdo-NMy/+omMy ./ho+/+NMs:msh+oMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMdoss-`/md//+yMy .oy///dNs`.+ssyMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMs..`ydymMMdoss////h-`--NMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMM:-``dMMMNdhyyss/s: :`dMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMm`:`.hmMh///+yh+o --+MMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMs.: -/` .:` .:-NMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMM:::::` -::/`dMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNs/-:`-::::..:-+hMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNhyyyyyyyydMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM\nMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"
13
+ adapter.message("```#{output.gsub('`', '\'')}```")
14
+ end
15
+
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Help < Command
6
+
7
+ def help
8
+ "# Get a list of all commands I understand\n.help\n"
9
+ end
10
+
11
+ def responds_to
12
+ ['help']
13
+ end
14
+
15
+ def respond_with(adapter)
16
+ output = []
17
+ adapter.commander.listeners.each { |l| output << l.help }
18
+ adapter.message("Here are all the commands I'll respond to. Anything in `[]` is considered an optional argument. ```#{output.compact.join("\n")}```")
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,47 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Http < Command
6
+
7
+ def help
8
+ "# Fetch specific HTTP headers, or all headers if no header names are provided\n.http|.head|.header|.headers [id] [header name] [header name] ...\n"
9
+ end
10
+
11
+ def responds_to
12
+ ['http', 'head', 'header', 'headers']
13
+ end
14
+
15
+ def respond_with(adapter)
16
+ if error
17
+ if args.length > 0
18
+ found = []
19
+ missing = []
20
+ headers = error.http_headers
21
+ args.each do |arg|
22
+ if headers.has_key?(arg.upcase)
23
+ found << "#{arg.upcase}: #{headers[arg.upcase].to_s.gsub('%', '%%')}"
24
+ else
25
+ missing << arg.upcase
26
+ end
27
+ end
28
+
29
+ if found.length > 0 && missing.length == 0
30
+ adapter.message("Here's what I found ```#{found.join("\n")}```")
31
+ elsif found.length > 0 && missing.length > 0
32
+ adapter.message("Below are the HTTP headers I managed to find. I wasn't able to find headers with the name `#{missing.to_sentence(words_connector: '`, `', two_words_connector: '` or `', last_word_connector: '`, or `')}` ```#{found.join("\n")}```")
33
+ elsif found.length == 0 && missing.length > 0
34
+ adapter.message("I couldn't find HTTP headers matching `#{missing.to_sentence(words_connector: '`, `', two_words_connector: '` or `', last_word_connector: '`, or `')}`")
35
+ end
36
+ else
37
+ output = error.http_headers.map { |k,v| "#{k}: #{v.to_s.gsub('%', '%%')}" }.join("\n")
38
+ adapter.message("Here's all the headers that were present when #{error.name.downcase} happened ```#{output}```")
39
+ end
40
+ else
41
+ adapter.message('Sorry, I wasn\'t able to find any exception to provide information on. Try specifying an exception id, like `.<command> <id>`')
42
+ end
43
+ end
44
+
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,23 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Stop < Command
6
+
7
+ def help
8
+ "# Stop and close the connection. It will be restarted if/when another exception occurs\n.stop|.close|.end|.disconnect\n"
9
+ end
10
+
11
+ def responds_to
12
+ ['stop', 'close', 'end', 'disconnect']
13
+ end
14
+
15
+ def respond_with(adapter)
16
+ if adapter.client.started?
17
+ adapter.client.stop!
18
+ end
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,25 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Trace < Command
6
+
7
+ def help
8
+ "# Retrieve the stack trace for the most recent exception id, or the specific exception if an id is provided\n.trace|.backtrace|.stack|.stacktrace [id]\n"
9
+ end
10
+
11
+ def responds_to
12
+ ['trace', 'backtrace', 'stack', 'stacktrace']
13
+ end
14
+
15
+ def respond_with(adapter)
16
+ if error
17
+ adapter.upload("Stack Trace ##{error.id}", "Here's the stack trace for #{error.name.downcase}", error.trace)
18
+ else
19
+ adapter.message('Sorry, I wasn\'t able to find any exception to provide information on. Try specifying an exception id, like `.<command> <id>`')
20
+ end
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,74 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class Trello < Command
6
+
7
+ def help
8
+ "# Create a Trello card for the most recent exception, or the specific exception if an id is provided\n.trello [id] [lane]\n"
9
+ end
10
+
11
+ def answer(text, adapter)
12
+ adapter.message('One second, I\'m working on it...')
13
+ lane, is_new = find_or_create_lane(text)
14
+ card = add_card(lane)
15
+ if is_new
16
+ adapter.message("Okay, I created the lane `#{lane.name}` and added the card for #{error.name.downcase} to it. #{card.short_url}")
17
+ else
18
+ adapter.message("Okay, I've added the card for #{error.name.downcase} to the `#{lane.name}` lane. #{card.short_url}")
19
+ end
20
+ end
21
+
22
+ def responds_to
23
+ ['trello']
24
+ end
25
+
26
+ def add_card(lane)
27
+ File.open("trace-#{error.id}.log", 'w+') { |f| f.write(error.trace) }
28
+ File.open("headers-#{error.id}.log", 'w+') { |f| error.http_headers.each { |h,v| f.write("#{h}: #{v}\n") } }
29
+
30
+ card = ::Trello::Card.create(name: error.name, desc: error.error, list_id: lane.id)
31
+ card.add_attachment(File.open("trace-#{error.id}.log", 'r'), 'Stack Trace')
32
+ card.add_attachment(File.open("headers-#{error.id}.log", 'r'), 'HTTP Headers')
33
+
34
+ error.update(status: :trello)
35
+ card
36
+ end
37
+
38
+ def find_or_create_lane(name)
39
+ lane = trello.lane(name)
40
+ if lane.blank?
41
+ lane = ::Trello::List.create(name: name, board_id: trello.board.id)
42
+ [lane, true]
43
+ else
44
+ [lane, false]
45
+ end
46
+ end
47
+
48
+ def respond_with(adapter)
49
+ if error
50
+ if error.in_trello? && !args.include?('-f')
51
+ adapter.message("My records indicate that a card for #{error.name.downcase} was already created. If you want to create it anyways, use `.trello #{error.id} #{args.length > 0 ? args.join(' ') + ' ' : ''}-f`")
52
+ else
53
+ params = args.reject { |a| a == '-f' }
54
+ if params.length > 0
55
+ answer(params.join(' '), adapter)
56
+ else
57
+ adapter.message('One second, I\'m getting a list of Trello lanes...')
58
+ adapter.ask("What lane should I add the card to? If you specify something not in this list I'll create it for you. ```#{trello.lanes.join("\n")}```", self)
59
+ end
60
+ end
61
+ else
62
+ adapter.message('Sorry, I wasn\'t able to find any exception to provide information on. Try specifying an exception id, like `.<command> <id>`')
63
+ end
64
+ end
65
+
66
+ private
67
+
68
+ def trello
69
+ @trello ||= ::Voltron::Defender::TrelloAdapter.new
70
+ end
71
+
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,27 @@
1
+ require 'voltron/defender/command'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class When < Command
6
+
7
+ include ::ActionView::Helpers::DateHelper
8
+
9
+ def help
10
+ "# Find out when the most recent exception occurred, or a specific exception if an id is given\n.when|.time [id]\n"
11
+ end
12
+
13
+ def responds_to
14
+ ['when', 'time']
15
+ end
16
+
17
+ def respond_with(adapter)
18
+ if error
19
+ adapter.message("#{error.name} happened #{distance_of_time_in_words(Time.now, error.created_at)} ago")
20
+ else
21
+ adapter.message('Sorry, I wasn\'t able to find any exception to provide information on. Try specifying an exception id, like `.<command> <id>`')
22
+ end
23
+ end
24
+
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,9 @@
1
+ module Voltron
2
+ class Defender
3
+ class Engine < Rails::Engine
4
+
5
+ isolate_namespace Voltron
6
+
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,83 @@
1
+ require 'slack'
2
+ require 'voltron/defender/commander'
3
+
4
+ module Voltron
5
+ class Defender
6
+ class SlackAdapter
7
+
8
+ attr_accessor :questioned, :asker
9
+
10
+ def initialize
11
+ client.on(:message) { |message| message_received(message) }
12
+ client.on(:close) { socket_closed }
13
+ end
14
+
15
+ def message_received(message)
16
+ # The bot is the user that posted the message, ignore whatever it said
17
+ return if client.self.id == message.user
18
+
19
+ nvm if is_command?(message.text)
20
+
21
+ if waiting?
22
+ client.typing channel: channel
23
+ asker.answer(message.text, self)
24
+ nvm
25
+ elsif commander.matches?(message.text)
26
+ client.typing channel: channel
27
+ commander.processor(message.text).respond_with(self)
28
+ end
29
+ end
30
+
31
+ def socket_closed
32
+ message "Connection has been closed, I'm no longer listening for commands"
33
+ end
34
+
35
+ def ask(question, asker, **args)
36
+ @questioned = true
37
+ @asker = asker
38
+ message(question, args)
39
+ end
40
+
41
+ def nvm
42
+ @questioned = false
43
+ @asker = nil
44
+ end
45
+
46
+ def attach(title=nil, text=nil, color=nil, **args)
47
+ payload = { pretext: title, color: color, text: text, mrkdwn_in: ['text', 'pretext'] }.compact.merge(args)
48
+ client.web_client.chat_postMessage channel: channel, attachments: [payload].to_json, as_user: true
49
+ end
50
+
51
+ def message(text, **args)
52
+ client.web_client.chat_postMessage channel: channel, text: (text % args), mrkdwn: true, as_user: true
53
+ end
54
+
55
+ def upload(name, title, content)
56
+ client.web_client.files_upload channels: channel, filename: name, title: title, content: content, as_user: true
57
+ end
58
+
59
+ def commander
60
+ @commander ||= ::Voltron::Defender::Commander.new
61
+ end
62
+
63
+ def waiting?
64
+ questioned == true
65
+ end
66
+
67
+ def is_command?(text)
68
+ text.to_s.strip.starts_with?('.')
69
+ end
70
+
71
+ def client
72
+ @client ||= ::Slack::RealTime::Client.new(token: Voltron.config.defender.slack_api_token, timeout: 10, open_timeout: 15)
73
+ end
74
+
75
+ private
76
+
77
+ def channel
78
+ '#' + Voltron.config.defender.slack_channel.to_s.gsub(/[^a-z0-9\-]/i, '')
79
+ end
80
+
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,32 @@
1
+ require 'trello'
2
+
3
+ module Voltron
4
+ class Defender
5
+ class TrelloAdapter
6
+
7
+ def initialize
8
+ ::Trello.configure do |config|
9
+ config.developer_public_key = Voltron.config.defender.trello_key
10
+ config.member_token = Voltron.config.defender.trello_token
11
+ end
12
+ end
13
+
14
+ def has_lane?(name)
15
+ lane.present?
16
+ end
17
+
18
+ def lane(name)
19
+ board.lists.find { |list| list.name.downcase == name.downcase }
20
+ end
21
+
22
+ def lanes
23
+ board.lists.map(&:name)
24
+ end
25
+
26
+ def board
27
+ @board ||= ::Trello::Board.find(Voltron.config.defender.trello_board)
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ module Voltron
2
+ class Defender
3
+ VERSION = '0.1.0'.freeze
4
+ end
5
+ end
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'voltron/defender/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'voltron-defender'
8
+ spec.version = Voltron::Defender::VERSION
9
+ spec.authors = ['Eric Hainer']
10
+ spec.email = ['eric@commercekitchen.com']
11
+
12
+ spec.summary = %q{Catch exceptions and report them to Slack}
13
+ spec.homepage = 'https://github.com/ehainer/voltron-defender'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = 'exe'
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'rails', '>= 4.2'
22
+ spec.add_dependency 'rack', '>= 1.6'
23
+ spec.add_dependency 'slack-ruby-client', '~> 0.8'
24
+ spec.add_dependency 'voltron', '>= 0.2.0'
25
+ spec.add_dependency 'eventmachine', '~> 1.2'
26
+ spec.add_dependency 'faye-websocket', '~> 0.10.7'
27
+ spec.add_dependency 'ruby-trello', '~> 2.0'
28
+
29
+ spec.add_development_dependency 'byebug'
30
+ spec.add_development_dependency 'simplecov', '0.11.0'
31
+ spec.add_development_dependency 'bundler', '~> 1.12'
32
+ spec.add_development_dependency 'rake', '~> 10.0'
33
+ spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'rspec-rails', '>= 3.4'
35
+ spec.add_development_dependency 'sqlite3', '>= 1.2'
36
+
37
+ end
metadata ADDED
@@ -0,0 +1,269 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: voltron-defender
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Eric Hainer
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rack
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: slack-ruby-client
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.8'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: voltron
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.2.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: eventmachine
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: faye-websocket
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.10.7
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.10.7
97
+ - !ruby/object:Gem::Dependency
98
+ name: ruby-trello
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: byebug
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '='
130
+ - !ruby/object:Gem::Version
131
+ version: 0.11.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '='
137
+ - !ruby/object:Gem::Version
138
+ version: 0.11.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: bundler
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '1.12'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '1.12'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '10.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '10.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec-rails
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '3.4'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '3.4'
195
+ - !ruby/object:Gem::Dependency
196
+ name: sqlite3
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '1.2'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '1.2'
209
+ description:
210
+ email:
211
+ - eric@commercekitchen.com
212
+ executables: []
213
+ extensions: []
214
+ extra_rdoc_files: []
215
+ files:
216
+ - ".gitignore"
217
+ - ".rspec"
218
+ - ".travis.yml"
219
+ - CODE_OF_CONDUCT.md
220
+ - Gemfile
221
+ - LICENSE.txt
222
+ - README.md
223
+ - Rakefile
224
+ - app/models/voltron/defender/error.rb
225
+ - bin/console
226
+ - bin/setup
227
+ - lib/generators/templates/db/migrate/create_voltron_defender_errors.rb
228
+ - lib/generators/voltron/defender/install_generator.rb
229
+ - lib/voltron/config/defender.rb
230
+ - lib/voltron/defender.rb
231
+ - lib/voltron/defender/command.rb
232
+ - lib/voltron/defender/commander.rb
233
+ - lib/voltron/defender/commands/defender.rb
234
+ - lib/voltron/defender/commands/help.rb
235
+ - lib/voltron/defender/commands/http.rb
236
+ - lib/voltron/defender/commands/stop.rb
237
+ - lib/voltron/defender/commands/trace.rb
238
+ - lib/voltron/defender/commands/trello.rb
239
+ - lib/voltron/defender/commands/when.rb
240
+ - lib/voltron/defender/engine.rb
241
+ - lib/voltron/defender/slack_adapter.rb
242
+ - lib/voltron/defender/trello_adapter.rb
243
+ - lib/voltron/defender/version.rb
244
+ - voltron-defender.gemspec
245
+ homepage: https://github.com/ehainer/voltron-defender
246
+ licenses:
247
+ - MIT
248
+ metadata: {}
249
+ post_install_message:
250
+ rdoc_options: []
251
+ require_paths:
252
+ - lib
253
+ required_ruby_version: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ required_rubygems_version: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
263
+ requirements: []
264
+ rubyforge_project:
265
+ rubygems_version: 2.6.13
266
+ signing_key:
267
+ specification_version: 4
268
+ summary: Catch exceptions and report them to Slack
269
+ test_files: []