sentry-rails 5.15.2 → 5.17.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b4d38fad3906b66ee90d7b6d7ab23e4ec4592c5f61d5b714774ef6c0ae5f63b
4
- data.tar.gz: ea4f14057e0032b3765b0e65a0af4bc95d1920355dd1daaf6121488ac68a2c22
3
+ metadata.gz: 27a2b73057d5fe8908b1a606879561617a0a0271bf618eb8f7ef23747b4bb4fc
4
+ data.tar.gz: f345d1d11c3b4f93c19766f58ce3c225599a739614084ae98ca8227ddee1f203
5
5
  SHA512:
6
- metadata.gz: 00d37cfb7c9eb73235f4a3147367acd576495141cd675e217cc78f8b452aa2e8fe56465e54c1fbe4bc62a489425547707d5e3e118a6a5a6b60f12fb3fa60b905
7
- data.tar.gz: 555a22f0a42d30afe3773a41040a4397288179d09a2a43639f9ec80a5ff499445823439511ee61a8dfc5026661abb347b7ffc6dd83545f371bd62c1eb16e9124
6
+ metadata.gz: 6b873d29072399adec9898a5318d494c6d6bf4ab253e5b9f6b6a0233c954e5bdad9b74929e8045f4db35b4ba1a7f0de9b08a3b8d2159da33c3cf55ba92b1ae83
7
+ data.tar.gz: a848c8424a8aa320f21f06ae3f0353830b3e6ea5d850f379f7642378a28fdd3307195ca48dc4964b9abacf3c84ac5edfc2fda9dc5da773791da9d3e5ccf0f85f
data/Gemfile CHANGED
@@ -17,7 +17,8 @@ rails_version = Gem::Version.new(rails_version)
17
17
  if rails_version < Gem::Version.new("6.0.0")
18
18
  gem "sqlite3", "~> 1.3.0", platform: :ruby
19
19
  else
20
- gem "sqlite3", platform: :ruby
20
+ # 1.7.0 dropped support for ruby < 3.0, remove later after upgrading craft setup
21
+ gem "sqlite3", "1.6.9", platform: :ruby
21
22
  end
22
23
 
23
24
  if rails_version >= Gem::Version.new("7.2.0.alpha")
data/Rakefile CHANGED
@@ -11,4 +11,4 @@ task :isolated_specs do
11
11
  end
12
12
  end
13
13
 
14
- task :default => [:spec, :isolated_specs]
14
+ task default: [:spec, :isolated_specs]
@@ -31,4 +31,3 @@ else
31
31
  class SendEventJob; end
32
32
  end
33
33
  end
34
-
@@ -104,7 +104,7 @@ module Sentry
104
104
  "service_url.active_storage" => %i[service key url],
105
105
  "service_update_metadata.active_storage" => %i[service key],
106
106
  "preview.active_storage" => %i[key],
107
- "analyze.active_storage" => %i[analyzer],
107
+ "analyze.active_storage" => %i[analyzer]
108
108
  }.freeze
109
109
 
110
110
  class Configuration
@@ -116,8 +116,8 @@ module Sentry
116
116
 
117
117
  # Rails catches exceptions in the ActionDispatch::ShowExceptions or
118
118
  # ActionDispatch::DebugExceptions middlewares, depending on the environment.
119
- # When `rails_report_rescued_exceptions` is true (it is by default), Sentry
120
- # will report exceptions even when they are rescued by these middlewares.
119
+ # When `report_rescued_exceptions` is true (it is by default), Sentry will
120
+ # report exceptions even when they are rescued by these middlewares.
121
121
  attr_accessor :report_rescued_exceptions
122
122
 
123
123
  # Some adapters, like sidekiq, already have their own sentry integration.
@@ -19,7 +19,13 @@ module Sentry
19
19
  tags.merge!(context.delete(:tags))
20
20
  end
21
21
 
22
- Sentry::Rails.capture_exception(error, level: severity, contexts: { "rails.error" => context }, tags: tags)
22
+ hint = {}
23
+ if context[:hint].is_a?(Hash)
24
+ context = context.dup
25
+ hint.merge!(context.delete(:hint))
26
+ end
27
+
28
+ Sentry::Rails.capture_exception(error, level: severity, contexts: { "rails.error" => context }, tags: tags, hint: hint)
23
29
  end
24
30
  end
25
31
  end
@@ -40,6 +40,7 @@ module Sentry
40
40
 
41
41
  configure_project_root
42
42
  configure_trusted_proxies
43
+ configure_cron_timezone
43
44
  extend_controller_methods if defined?(ActionController)
44
45
  patch_background_worker if defined?(ActiveRecord)
45
46
  override_streaming_reporter if defined?(ActionView)
@@ -70,6 +71,11 @@ module Sentry
70
71
  Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies)
71
72
  end
72
73
 
74
+ def configure_cron_timezone
75
+ tz_info = ::ActiveSupport::TimeZone.find_tzinfo(::Rails.application.config.time_zone)
76
+ Sentry.configuration.cron.default_timezone = tz_info.name
77
+ end
78
+
73
79
  def extend_controller_methods
74
80
  require "sentry/rails/controller_methods"
75
81
  require "sentry/rails/controller_transaction"
@@ -2,7 +2,6 @@ module Sentry
2
2
  module Rails
3
3
  module Tracing
4
4
  class AbstractSubscriber
5
-
6
5
  class << self
7
6
  def subscribe!
8
7
  raise NotImplementedError
@@ -27,11 +27,12 @@ module Sentry
27
27
 
28
28
  next unless connection
29
29
 
30
- db_config = if connection.pool.respond_to?(:db_config)
31
- connection.pool.db_config.configuration_hash
32
- elsif connection.pool.respond_to?(:spec)
33
- connection.pool.spec.config
34
- end
30
+ db_config =
31
+ if connection.pool.respond_to?(:db_config)
32
+ connection.pool.db_config.configuration_hash
33
+ elsif connection.pool.respond_to?(:spec)
34
+ connection.pool.spec.config
35
+ end
35
36
 
36
37
  next unless db_config
37
38
 
@@ -4,7 +4,7 @@ module Sentry
4
4
  module Rails
5
5
  module Tracing
6
6
  class ActiveStorageSubscriber < AbstractSubscriber
7
- EVENT_NAMES = %w(
7
+ EVENT_NAMES = %w[
8
8
  service_upload.active_storage
9
9
  service_download.active_storage
10
10
  service_streaming_download.active_storage
@@ -17,7 +17,7 @@ module Sentry
17
17
  service_update_metadata.active_storage
18
18
  preview.active_storage
19
19
  analyze.active_storage
20
- ).freeze
20
+ ].freeze
21
21
 
22
22
  def self.subscribe!
23
23
  subscribe_to_event(EVENT_NAMES) do |event_name, duration, payload|
@@ -1,5 +1,5 @@
1
1
  module Sentry
2
2
  module Rails
3
- VERSION = "5.15.2"
3
+ VERSION = "5.17.0"
4
4
  end
5
5
  end
data/sentry-rails.gemspec CHANGED
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ["lib"]
24
24
 
25
25
  spec.add_dependency "railties", ">= 5.0"
26
- spec.add_dependency "sentry-ruby", "~> 5.15.2"
26
+ spec.add_dependency "sentry-ruby", "~> 5.17.0"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.15.2
4
+ version: 5.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-18 00:00:00.000000000 Z
11
+ date: 2024-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 5.15.2
33
+ version: 5.17.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 5.15.2
40
+ version: 5.17.0
41
41
  description: A gem that provides Rails integration for the Sentry error logger
42
42
  email: accounts@sentry.io
43
43
  executables: []