appsignal 4.0.2 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 898cc61dd09079372dd341fcc77815283720d773a249c951383ac4be7ce031d8
4
- data.tar.gz: 2d3d8fa4dfe45a3a42c89955bd243cd2c7871b3f2ac2978e7bef8333b6518b5e
3
+ metadata.gz: 41324be9bb4bd42bfcee997c778b0ae1eb0a1a773e044503eab2466779f3bcb7
4
+ data.tar.gz: 1ab95f249d94eedba7e86e36d3f74d217bd57deed236e6b352b190dc34007eb5
5
5
  SHA512:
6
- metadata.gz: 492ff15286cd7d5ce8064e57ca959dc9b308fc452237463a35b0d64d978bc1b6bff834b078af6a6a19fa0881e88ccb21d24c9f25d7f7a4c721435423d3b81d75
7
- data.tar.gz: 52e9a83f45fe345d895453e38833047c305f0b474918d8510148959a87a8e1ae797773213082152a03a19f8fd9cd7adfc37b5b0b6c33572f97fd9fdf3d67b5e1
6
+ metadata.gz: f8e8e89b583dc585b83fcfc70378f5090e0854d7c19b2f375a68739fc1325bcd184d8ab678fdb68af55e32d81d60ecbb764d3768f0d2c02ea6d1a974b808018c
7
+ data.tar.gz: d25b331756ceafe336d5b430577fb98da0696f5f92613a47d89f30007b910a4057cf981ddb1d841d295cfdb31f48d69bb8fecb1e7071d933dba47b1160d701bf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 4.0.3
4
+
5
+ _Published on 2024-08-26._
6
+
7
+ ### Changed
8
+
9
+ - Do not report Sidekiq `Sidekiq::JobRetry::Handled` and `Sidekiq::JobRetry::Skip` errors. These errors would be reported by our Rails error subscriber. These are an internal Sidekiq errors we do not need to report. (patch [e385ee2c](https://github.com/appsignal/appsignal-ruby/commit/e385ee2c4da13063e6f1a7a207286dda74113fc4))
10
+
11
+ ### Removed
12
+
13
+ - Remove the `app_path` writer in the `Appsignal.configure` helper. This was deprecated in version 3.x. It is removed now in the next major version.
14
+
15
+ Use the `root_path` keyword argument in the `Appsignal.configure` helper (`Appsignal.configure(:root_path => "...")`) to change the AppSignal root path if necessary.
16
+
17
+ (patch [6335da6d](https://github.com/appsignal/appsignal-ruby/commit/6335da6d99a5ba7687fb5885eee27b9633d80474))
18
+
3
19
  ## 4.0.2
4
20
 
5
21
  _Published on 2024-08-23._
@@ -225,7 +225,7 @@ module Appsignal
225
225
  # How to integrate AppSignal manually
226
226
  def initialize(
227
227
  root_path,
228
- initial_env,
228
+ env,
229
229
  logger = Appsignal.internal_logger
230
230
  )
231
231
  @root_path = root_path
@@ -234,8 +234,7 @@ module Appsignal
234
234
  @logger = logger
235
235
  @valid = false
236
236
 
237
- @initial_env = initial_env
238
- @env = initial_env.to_s
237
+ @env = env.to_s
239
238
  @config_hash = {}
240
239
  @system_config = {}
241
240
  @loaders_config = {}
@@ -270,7 +269,7 @@ module Appsignal
270
269
  end
271
270
 
272
271
  # Track origin of env
273
- @initial_config[:env] = @initial_env.to_s
272
+ @initial_config[:env] = @env
274
273
 
275
274
  # Load the config file if it exists
276
275
  @file_config = load_from_disk || {}
@@ -560,14 +559,6 @@ module Appsignal
560
559
  @config.root_path
561
560
  end
562
561
 
563
- def app_path=(_path)
564
- Appsignal::Utils::StdoutAndLoggerMessage.warning \
565
- "The `Appsignal.configure`'s `app_path=` writer is deprecated " \
566
- "and can no longer be used to set the root path. " \
567
- "Use the `Appsignal.configure`'s method `root_path` keyword argument " \
568
- "to set the root path."
569
- end
570
-
571
562
  def env
572
563
  @config.env
573
564
  end
@@ -102,14 +102,9 @@ module Appsignal
102
102
 
103
103
  private
104
104
 
105
- IGNORED_ERRORS = [
106
- # We don't need to alert Sidekiq job skip errors.
107
- # This is an internal Sidekiq error.
108
- "Sidekiq::JobRetry::Skip"
109
- ].freeze
110
-
111
105
  def ignored_error?(error)
112
- IGNORED_ERRORS.include?(error.class.name)
106
+ # We don't need to alert about Sidekiq job internal errors.
107
+ defined?(Sidekiq::JobRetry::Handled) && error.is_a?(Sidekiq::JobRetry::Handled)
113
108
  end
114
109
 
115
110
  def context_for(context)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "4.0.2"
4
+ VERSION = "4.0.3"
5
5
  end
@@ -1363,30 +1363,5 @@ describe Appsignal::Config do
1363
1363
 
1364
1364
  expect(dsl.cpu_count).to eq(1.0)
1365
1365
  end
1366
-
1367
- describe "#app_path=" do
1368
- it "prints a deprecation warning" do
1369
- err_stream = std_stream
1370
- capture_std_streams(std_stream, err_stream) do
1371
- dsl.app_path = "foo"
1372
- end
1373
-
1374
- expect(err_stream.read).to include(
1375
- "appsignal WARNING: The `Appsignal.configure`'s `app_path=` writer is deprecated"
1376
- )
1377
- end
1378
-
1379
- it "logs a deprecation warning" do
1380
- logs =
1381
- capture_logs do
1382
- silence { dsl.app_path = "foo" }
1383
- end
1384
-
1385
- expect(logs).to contains_log(
1386
- :warn,
1387
- "The `Appsignal.configure`'s `app_path=` writer is deprecated"
1388
- )
1389
- end
1390
- end
1391
1366
  end
1392
1367
  end
@@ -115,12 +115,33 @@ describe Appsignal::Environment do
115
115
  end
116
116
 
117
117
  describe ".report_supported_gems" do
118
- it "reports about all AppSignal supported gems in the bundle" do
118
+ it "reports about all AppSignal supported gems in the bundle using Bundler all_specs" do
119
119
  logs = capture_logs { described_class.report_supported_gems }
120
120
 
121
121
  expect(logs).to be_empty
122
122
 
123
- bundle_gem_specs = ::Bundler.rubygems.all_specs
123
+ if Bundler.rubygems.respond_to?(:all_specs)
124
+ skip "Using new Bundler version without `all_specs` method"
125
+ end
126
+ bundle_gem_specs = silence { ::Bundler.rubygems.all_specs }
127
+ rack_spec = bundle_gem_specs.find { |s| s.name == "rack" }
128
+ rake_spec = bundle_gem_specs.find { |s| s.name == "rake" }
129
+ expect_environment_metadata("ruby_rack_version", rack_spec.version.to_s)
130
+ expect_environment_metadata("ruby_rake_version", rake_spec.version.to_s)
131
+ expect(rack_spec.version.to_s).to_not be_empty
132
+ expect(rake_spec.version.to_s).to_not be_empty
133
+ end
134
+
135
+ it "reports about all AppSignal supported gems in the bundle using bundler installed_specs" do
136
+ unless Bundler.rubygems.respond_to?(:installed_specs)
137
+ skip "Using old Bundler version without `installed_specs` method"
138
+ end
139
+
140
+ logs = capture_logs { described_class.report_supported_gems }
141
+
142
+ expect(logs).to be_empty
143
+
144
+ bundle_gem_specs = ::Bundler.rubygems.installed_specs
124
145
  rack_spec = bundle_gem_specs.find { |s| s.name == "rack" }
125
146
  rake_spec = bundle_gem_specs.find { |s| s.name == "rake" }
126
147
  expect_environment_metadata("ruby_rack_version", rack_spec.version.to_s)
@@ -229,15 +229,36 @@ if DependencyHelper.rails_present?
229
229
  expect(last_transaction).to have_error("ExampleStandardError", "error message")
230
230
  end
231
231
 
232
- it "ignores Sidekiq::JobRetry::Skip errors" do
233
- require "sidekiq"
234
- require "sidekiq/job_retry"
232
+ context "Sidekiq internal errors" do
233
+ before do
234
+ require "sidekiq"
235
+ require "sidekiq/job_retry"
236
+ end
235
237
 
236
- with_rails_error_reporter do
237
- Rails.error.handle { raise Sidekiq::JobRetry::Skip, "error message" }
238
+ it "ignores Sidekiq::JobRetry::Handled errors" do
239
+ with_rails_error_reporter do
240
+ Rails.error.handle { raise Sidekiq::JobRetry::Handled, "error message" }
241
+ end
242
+
243
+ expect(last_transaction).to_not have_error
238
244
  end
239
245
 
240
- expect(last_transaction).to_not have_error
246
+ it "ignores Sidekiq::JobRetry::Skip errors" do
247
+ with_rails_error_reporter do
248
+ Rails.error.handle { raise Sidekiq::JobRetry::Skip, "error message" }
249
+ end
250
+
251
+ expect(last_transaction).to_not have_error
252
+ end
253
+
254
+ it "doesn't crash when no Sidekiq error classes are found" do
255
+ hide_const("Sidekiq::JobRetry")
256
+ with_rails_error_reporter do
257
+ Rails.error.handle { raise ExampleStandardError, "error message" }
258
+ end
259
+
260
+ expect(last_transaction).to have_error("ExampleStandardError", "error message")
261
+ end
241
262
  end
242
263
 
243
264
  context "when no transaction is active" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-08-23 00:00:00.000000000 Z
13
+ date: 2024-08-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack