bugsnag 6.12.0 → 6.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.buildkite/pipeline.yml +470 -0
  3. data/.rubocop.yml +55 -0
  4. data/.rubocop_todo.yml +530 -160
  5. data/CHANGELOG.md +67 -0
  6. data/CONTRIBUTING.md +1 -9
  7. data/Gemfile +14 -7
  8. data/TESTING.md +81 -0
  9. data/VERSION +1 -1
  10. data/docker-compose.yml +46 -0
  11. data/dockerfiles/Dockerfile.jruby-unit-tests +13 -0
  12. data/dockerfiles/Dockerfile.ruby-maze-runner +26 -0
  13. data/dockerfiles/Dockerfile.ruby-unit-tests +12 -0
  14. data/features/delayed_job.feature +6 -22
  15. data/features/fixtures/delayed_job/Dockerfile +2 -4
  16. data/features/fixtures/delayed_job/app/Gemfile +1 -1
  17. data/features/fixtures/delayed_job/app/Rakefile +18 -0
  18. data/features/fixtures/docker-compose.yml +28 -40
  19. data/features/fixtures/expected_breadcrumbs/active_job.json +9 -0
  20. data/features/fixtures/expected_breadcrumbs/mongo_failed.json +15 -0
  21. data/features/fixtures/expected_breadcrumbs/mongo_filtered_request.json +15 -0
  22. data/features/fixtures/expected_breadcrumbs/mongo_filtered_result.json +15 -0
  23. data/features/fixtures/expected_breadcrumbs/mongo_success.json +14 -0
  24. data/features/fixtures/expected_breadcrumbs/request.json +13 -0
  25. data/features/fixtures/expected_breadcrumbs/sql_with_bindings.json +12 -0
  26. data/features/fixtures/expected_breadcrumbs/sql_without_bindings.json +11 -0
  27. data/features/fixtures/plain/Dockerfile +2 -2
  28. data/features/fixtures/plain/app/app.rb +1 -3
  29. data/features/fixtures/plain/app/delivery/fork_threadpool.rb +3 -1
  30. data/features/fixtures/plain/app/unhandled/{Interrupt.rb → interrupt.rb} +0 -0
  31. data/features/fixtures/rack1/Dockerfile +2 -2
  32. data/features/fixtures/rack2/Dockerfile +2 -2
  33. data/features/fixtures/rails3/Dockerfile +2 -2
  34. data/features/fixtures/rails3/app/Gemfile +4 -0
  35. data/features/fixtures/rails3/app/config/initializers/bugsnag.rb +3 -2
  36. data/features/fixtures/rails4/Dockerfile +2 -5
  37. data/features/fixtures/rails4/app/config/initializers/bugsnag.rb +2 -1
  38. data/features/fixtures/rails5/Dockerfile +2 -2
  39. data/features/fixtures/rails5/app/Gemfile +3 -2
  40. data/features/fixtures/rails5/app/config/initializers/bugsnag.rb +2 -1
  41. data/features/fixtures/rails6/Dockerfile +2 -2
  42. data/features/fixtures/rails6/app/Gemfile +3 -2
  43. data/features/fixtures/rails6/app/app/controllers/mongo_controller.rb +22 -0
  44. data/features/fixtures/rails6/app/app/models/mongo_model.rb +6 -0
  45. data/features/fixtures/rails6/app/config/environments/development.rb +2 -0
  46. data/features/fixtures/rails6/app/config/environments/production.rb +1 -0
  47. data/features/fixtures/rails6/app/config/environments/rails_env.rb +1 -0
  48. data/features/fixtures/rails6/app/config/environments/test.rb +1 -0
  49. data/features/fixtures/rails6/app/config/initializers/bugsnag.rb +2 -1
  50. data/features/fixtures/rails6/app/config/mongoid.yml +23 -0
  51. data/features/fixtures/rails6/app/config/routes.rb +4 -0
  52. data/features/fixtures/resque/Dockerfile +2 -2
  53. data/features/fixtures/sidekiq/Dockerfile +5 -7
  54. data/features/fixtures/sidekiq/app/Gemfile +2 -1
  55. data/features/fixtures/sidekiq/app/Rakefile.rb +14 -0
  56. data/features/fixtures/sinatra1/Dockerfile +2 -2
  57. data/features/fixtures/sinatra2/Dockerfile +2 -2
  58. data/features/plain_features/add_tab.feature +24 -97
  59. data/features/plain_features/app_type.feature +6 -25
  60. data/features/plain_features/app_version.feature +6 -25
  61. data/features/plain_features/auto_notify.feature +4 -20
  62. data/features/plain_features/delivery.feature +12 -60
  63. data/features/plain_features/exception_data.feature +24 -94
  64. data/features/plain_features/filters.feature +9 -43
  65. data/features/plain_features/handled_errors.feature +16 -78
  66. data/features/plain_features/ignore_classes.feature +5 -23
  67. data/features/plain_features/ignore_report.feature +6 -24
  68. data/features/plain_features/proxies.feature +13 -56
  69. data/features/plain_features/release_stages.feature +9 -40
  70. data/features/plain_features/report_api_key.feature +9 -35
  71. data/features/plain_features/report_severity.feature +8 -35
  72. data/features/plain_features/report_stack_frames.feature +24 -92
  73. data/features/plain_features/report_user.feature +23 -96
  74. data/features/plain_features/unhandled_errors.feature +17 -88
  75. data/features/rails_features/api_key.feature +12 -58
  76. data/features/rails_features/app_type.feature +13 -58
  77. data/features/rails_features/app_version.feature +19 -80
  78. data/features/rails_features/auto_capture_sessions.feature +31 -112
  79. data/features/rails_features/auto_notify.feature +28 -105
  80. data/features/rails_features/before_notify.feature +18 -83
  81. data/features/rails_features/breadcrumbs.feature +40 -137
  82. data/features/rails_features/handled.feature +18 -82
  83. data/features/rails_features/ignore_classes.feature +12 -51
  84. data/features/rails_features/meta_data_filters.feature +9 -33
  85. data/features/rails_features/mongo_breadcrumbs.feature +22 -96
  86. data/features/rails_features/project_root.feature +19 -84
  87. data/features/rails_features/release_stage.feature +20 -82
  88. data/features/rails_features/send_code.feature +13 -55
  89. data/features/rails_features/send_environment.feature +7 -33
  90. data/features/rails_features/unhandled.feature +6 -31
  91. data/features/rails_features/user_info.feature +27 -65
  92. data/features/sidekiq.feature +12 -79
  93. data/features/steps/ruby_notifier_steps.rb +59 -15
  94. data/features/support/env.rb +12 -45
  95. data/lib/bugsnag.rb +74 -21
  96. data/lib/bugsnag/breadcrumbs/breadcrumbs.rb +0 -2
  97. data/lib/bugsnag/breadcrumbs/validator.rb +0 -6
  98. data/lib/bugsnag/cleaner.rb +129 -60
  99. data/lib/bugsnag/configuration.rb +31 -2
  100. data/lib/bugsnag/helpers.rb +2 -4
  101. data/lib/bugsnag/integrations/que.rb +7 -4
  102. data/lib/bugsnag/integrations/railtie.rb +1 -1
  103. data/lib/bugsnag/middleware/discard_error_class.rb +30 -0
  104. data/lib/bugsnag/middleware/exception_meta_data.rb +15 -9
  105. data/lib/bugsnag/middleware/ignore_error_class.rb +2 -0
  106. data/lib/bugsnag/middleware/rack_request.rb +2 -4
  107. data/lib/bugsnag/report.rb +3 -13
  108. data/lib/bugsnag/stacktrace.rb +6 -10
  109. data/spec/breadcrumbs/breadcrumb_spec.rb +1 -1
  110. data/spec/breadcrumbs/validator_spec.rb +1 -26
  111. data/spec/bugsnag_spec.rb +2 -2
  112. data/spec/cleaner_spec.rb +202 -10
  113. data/spec/configuration_spec.rb +16 -1
  114. data/spec/fixtures/apps/rails-initializer-config/Gemfile +5 -1
  115. data/spec/fixtures/apps/rails-invalid-initializer-config/Gemfile +5 -1
  116. data/spec/fixtures/apps/rails-no-config/Gemfile +5 -1
  117. data/spec/helper_spec.rb +0 -31
  118. data/spec/integrations/logger_spec.rb +1 -1
  119. data/spec/integrations/rack_spec.rb +8 -6
  120. data/spec/integrations/rake_spec.rb +1 -1
  121. data/spec/report_spec.rb +324 -26
  122. data/spec/spec_helper.rb +6 -1
  123. data/spec/stacktrace_spec.rb +179 -72
  124. metadata +23 -7
  125. data/.travis.yml +0 -117
  126. data/features/plain_features/api_key.feature +0 -25
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Start perform ActiveJob",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "event_name": "perform_start.active_job",
7
+ "event_id": ".*"
8
+ }
9
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query failed",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "bogus",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.failed",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": 1,
13
+ "message": "no such command: 'bogus' (59)"
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "find",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models",
13
+ "filter": "{\"string_field\":\"?\"}"
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "find",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models",
13
+ "filter": "{\"$or\":[{\"string_field\":\"?\"},{\"numeric_field\":\"?\"}]}"
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "type": "process",
3
+ "name": "Mongo query succeeded",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "command_name": "insert",
7
+ "database_name": "^rails\\d_development$",
8
+ "operation_id": "NUMBER",
9
+ "event_name": "mongo.succeeded",
10
+ "request_id": "NUMBER",
11
+ "duration": "NUMBER",
12
+ "collection": "mongo_models"
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "request",
3
+ "name": "Controller started processing",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "controller": "BreadcrumbsController",
7
+ "action": "handled",
8
+ "method": "GET",
9
+ "path": "/breadcrumbs/handled",
10
+ "event_name": "start_processing.action_controller",
11
+ "event_id": ".*"
12
+ }
13
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "type": "process",
3
+ "name": "ActiveRecord SQL query",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "name": "User Load",
7
+ "connection_id": "NUMBER",
8
+ "event_name": "sql.active_record",
9
+ "event_id": ".*",
10
+ "binds": "{\"email\":\"?\",\"LIMIT\":\"?\"}"
11
+ }
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "type": "process",
3
+ "name": "ActiveRecord SQL query",
4
+ "timestamp": "^\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}:[\\d\\.]+Z?$",
5
+ "metaData": {
6
+ "name": "User Load",
7
+ "connection_id": "NUMBER",
8
+ "event_name": "sql.active_record",
9
+ "event_id": ".*"
10
+ }
11
+ }
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -4,13 +4,11 @@ require 'pp'
4
4
  def configure_basics
5
5
  Bugsnag.configure do |conf|
6
6
  conf.api_key = ENV['BUGSNAG_API_KEY']
7
- conf.endpoint = ENV['BUGSNAG_ENDPOINT']
8
- conf.session_endpoint = ENV["BUGSNAG_SESSION_ENDPOINT"] if ENV.include? "BUGSNAG_SESSION_ENDPOINT"
7
+ conf.set_endpoints(ENV['BUGSNAG_ENDPOINT'], ENV["BUGSNAG_ENDPOINT"])
9
8
  end
10
9
  end
11
10
 
12
11
  def configure_using_environment
13
- pp ENV
14
12
  Bugsnag.configure do |conf|
15
13
  conf.app_type = ENV["BUGSNAG_APP_TYPE"] if ENV.include? "BUGSNAG_APP_TYPE"
16
14
  conf.app_version = ENV["BUGSNAG_APP_VERSION"] if ENV.include? "BUGSNAG_APP_VERSION"
@@ -13,6 +13,8 @@ Bugsnag.notify("handled string") do |report|
13
13
  })
14
14
  end
15
15
 
16
+ # Added to stop Process deadlock
17
+ sleep(0.01)
16
18
  Process.fork do
17
19
  Bugsnag.notify("handled string number 2") do |report|
18
20
  report.add_tab(:config, {
@@ -22,4 +24,4 @@ Process.fork do
22
24
  end
23
25
  end
24
26
 
25
- Process.wait
27
+ Process.wait
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ gem 'rake', '~> 12.3.0'
4
+
3
5
  gem 'rails', '3.2.22.5'
4
6
 
5
7
  gem 'nokogiri', '1.6.8'
@@ -10,4 +12,6 @@ gem 'jquery-rails'
10
12
 
11
13
  gem 'bugsnag', path: '/bugsnag'
12
14
 
15
+ gem 'rack-cache', '~> 1.9.0'
16
+
13
17
  gem "warden"
@@ -7,14 +7,15 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
14
+ config.meta_data_filters << 'filtered_parameter'
14
15
 
15
16
  if ENV["SQL_ONLY_BREADCRUMBS"] == "true"
16
17
  config.before_breadcrumb_callbacks << Proc.new do |breadcrumb|
17
18
  breadcrumb.ignore! unless breadcrumb.meta_data[:event_name] == "sql.active_record" && breadcrumb.meta_data[:name] == "User Load"
18
19
  end
19
20
  end
20
- end
21
+ end
@@ -1,8 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
3
-
4
- ARG RUBY_VERSION
5
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
6
3
 
7
4
  WORKDIR /bugsnag
8
5
  COPY temp-bugsnag-lib ./
@@ -7,10 +7,11 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
14
+ config.meta_data_filters << 'filtered_parameter'
14
15
 
15
16
  if ENV["SQL_ONLY_BREADCRUMBS"] == "true"
16
17
  config.before_breadcrumb_callbacks << Proc.new do |breadcrumb|
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -43,8 +43,9 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
43
43
  # Added at 2018-03-26 15:20:23 +0100 by amoinet:
44
44
  gem 'bugsnag', path: '/bugsnag'
45
45
 
46
- # Added at 2018-04-26 10:20:10 +0100 by amoinet:
47
- gem "clearance", "~> 1.16"
46
+ # Clearance breaks in Ruby < 2.3 and needs to be pinned to `1.16.1`
47
+ ruby_version = Gem::Version.new(RUBY_VERSION)
48
+ gem "clearance", ruby_version < Gem::Version.new('2.3.0') ? '1.16.1' : '~> 1.16'
48
49
 
49
50
  gem "mongoid"
50
51
 
@@ -7,10 +7,11 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
14
+ config.meta_data_filters << 'filtered_parameter'
14
15
 
15
16
  if ENV["SQL_ONLY_BREADCRUMBS"] == "true"
16
17
  config.before_breadcrumb_callbacks << Proc.new do |breadcrumb|
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  RUN apt-get update
5
5
 
@@ -51,7 +51,8 @@ end
51
51
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
52
52
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
53
53
 
54
- # Added at 2019-04-24 17:24:14 +0100 by amoinet:
55
- gem "bugsnag", "~> 6.11"
54
+ gem 'bugsnag', path: '/bugsnag'
55
+
56
+ gem "mongoid"
56
57
 
57
58
  gem "clearance", "~> 1.16"
@@ -0,0 +1,22 @@
1
+ class MongoController < ApplicationController
2
+ def success_crash
3
+ doc = MongoModel.create(string_field: "String")
4
+ doc.save
5
+ "Statement".prepnd("Failing")
6
+ end
7
+
8
+ def get_crash
9
+ MongoModel.where(string_field: true).as_json
10
+ MongoModel.any_of({string_field: true}, {numeric_field: 123}).as_json
11
+ "Statement".prepnd("Failing")
12
+ end
13
+
14
+ def failure_crash
15
+ begin
16
+ Mongoid::Clients.default.database.command(:bogus => 1)
17
+ rescue
18
+ end
19
+
20
+ "Statement".prepnd("Failing")
21
+ end
22
+ end
@@ -0,0 +1,6 @@
1
+ class MongoModel
2
+ include Mongoid::Document
3
+
4
+ field :string_field, type: String
5
+ field :numeric_field, type: Integer
6
+ end
@@ -59,4 +59,6 @@ Rails.application.configure do
59
59
  # Use an evented file watcher to asynchronously detect changes in source code,
60
60
  # routes, locales, etc. This feature depends on the listen gem.
61
61
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
62
+
63
+ config.hosts << "rails6"
62
64
  end
@@ -109,4 +109,5 @@ Rails.application.configure do
109
109
  # config.active_record.database_selector = { delay: 2.seconds }
110
110
  # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
111
111
  # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
112
+ config.hosts << "rails6"
112
113
  end
@@ -52,4 +52,5 @@ Rails.application.configure do
52
52
  # routes, locales, etc. This feature depends on the listen gem.
53
53
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
54
  config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
55
+ config.hosts << "rails6"
55
56
  end
@@ -44,4 +44,5 @@ Rails.application.configure do
44
44
 
45
45
  # Raises error for missing translations.
46
46
  # config.action_view.raise_on_missing_translations = true
47
+ config.hosts << "rails6"
47
48
  end
@@ -7,10 +7,11 @@ Bugsnag.configure do |config|
7
7
  config.auto_notify = ENV["BUGSNAG_AUTO_NOTIFY"] != "false"
8
8
  config.project_root = ENV["BUGSNAG_PROJECT_ROOT"] if ENV.include? "BUGSNAG_PROJECT_ROOT"
9
9
  config.ignore_classes << lambda { |ex| ex.class.to_s == ENV["BUGSNAG_IGNORE_CLASS"] } if ENV.include? "BUGSNAG_IGNORE_CLASS"
10
- config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"]
10
+ config.auto_capture_sessions = ENV["BUGSNAG_AUTO_CAPTURE_SESSIONS"] == "true" unless ENV["USE_DEFAULT_AUTO_CAPTURE_SESSIONS"] == "true"
11
11
  config.release_stage = ENV["BUGSNAG_RELEASE_STAGE"] if ENV.include? "BUGSNAG_RELEASE_STAGE"
12
12
  config.send_code = ENV["BUGSNAG_SEND_CODE"] != "false"
13
13
  config.send_environment = ENV["BUGSNAG_SEND_ENVIRONMENT"] == "true"
14
+ config.meta_data_filters << 'filtered_parameter'
14
15
 
15
16
  if ENV["SQL_ONLY_BREADCRUMBS"] == "true"
16
17
  config.before_breadcrumb_callbacks << Proc.new do |breadcrumb|
@@ -0,0 +1,23 @@
1
+ development:
2
+ # Configure available database clients. (required)
3
+ clients:
4
+ # Defines the default client. (required)
5
+ default:
6
+ # Defines the name of the default database that Mongoid can connect to.
7
+ # (required).
8
+ database: rails6_development
9
+ # Provides the hosts the default client can connect to. Must be an array
10
+ # of host:port pairs. (required)
11
+ hosts:
12
+ - mongo:27017
13
+
14
+ test:
15
+ clients:
16
+ default:
17
+ database: rails6_test
18
+ hosts:
19
+ - mongo:27017
20
+ options:
21
+ read:
22
+ mode: :primary
23
+ max_pool_size: 1
@@ -55,4 +55,8 @@ Rails.application.routes.draw do
55
55
  get 'breadcrumbs/sql_breadcrumb', to: 'breadcrumbs#sql_breadcrumb'
56
56
  get 'breadcrumbs/active_job', to: 'breadcrumbs#active_job'
57
57
  get 'breadcrumbs/cache_read', to: 'breadcrumbs#cache_read'
58
+
59
+ get 'mongo/success_crash', to: 'mongo#success_crash'
60
+ get 'mongo/get_crash', to: 'mongo#get_crash'
61
+ get 'mongo/failure_crash', to: 'mongo#failure_crash'
58
62
  end
@@ -1,5 +1,5 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
@@ -1,19 +1,17 @@
1
- ARG RUBY_VERSION
2
- FROM ruby:$RUBY_VERSION
1
+ ARG RUBY_TEST_VERSION
2
+ FROM ruby:$RUBY_TEST_VERSION
3
3
 
4
4
  WORKDIR /bugsnag
5
5
  COPY temp-bugsnag-lib ./
6
6
 
7
7
  ARG APP_PATH
8
8
 
9
- WORKDIR $APP_PATH
9
+ WORKDIR /app/
10
10
 
11
+ COPY app/Gemfile Gemfile
11
12
  ARG SIDEKIQ_VERSION
12
13
  ENV SIDEKIQ_VERSION $SIDEKIQ_VERSION
13
14
 
14
- COPY app/Gemfile $APP_PATH
15
15
  RUN bundle install
16
16
 
17
- COPY app/ $APP_PATH
18
-
19
- CMD ["bundle", "exec", "sidekiq", "-r", "./app.rb"]
17
+ COPY app/ /app/