appsignal 3.0.18 → 3.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +134 -0
- data/CHANGELOG.md +10 -0
- data/build_matrix.yml +8 -1
- data/ext/base.rb +2 -1
- data/gemfiles/rails-6.1.gemfile +7 -0
- data/gemfiles/rails-7.0.gemfile +1 -1
- data/lib/appsignal/cli/diagnose/utils.rb +0 -14
- data/lib/appsignal/cli/diagnose.rb +3 -3
- data/lib/appsignal/event_formatter/sequel/sql_formatter.rb +24 -0
- data/lib/appsignal/system.rb +0 -4
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +4 -4
- data/spec/lib/appsignal/event_formatter/active_record/sql_formatter_spec.rb +2 -2
- data/spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb +30 -0
- data/spec/lib/appsignal/hooks/activejob_spec.rb +2 -19
- data/spec/lib/appsignal/hooks/sequel_spec.rb +1 -1
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +3 -2
- data/spec/lib/appsignal_spec.rb +1 -2
- data/spec/support/helpers/activejob_helpers.rb +27 -0
- data/spec/support/helpers/dependency_helper.rb +13 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff92b4ae6715fa80b1910e0023b49e0032a28fa1ea13b7b64587568ceae07edf
|
4
|
+
data.tar.gz: 6faac0d1b0fa8abefc0908628a98918d3cbec6eae45ae4a7d275c4537eb03b59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cd66bc7159a7ce2817d5190073d4af45e5f7dcb7c5f7c5c9ebdf6b986af9f3e3b46f7149a3fabf81ce03a03c62734c87984f92b5f0a468240b9d3a7b513168f
|
7
|
+
data.tar.gz: cf0735657d7c4ebcaff3c28863d7ee8e5b244f8945dbe16d0d764130826d99bce49aca1c13a5adbd62a196acbf23827fcbfe8a3558843298e56585896a3a0812
|
data/.semaphore/semaphore.yml
CHANGED
@@ -446,6 +446,25 @@ blocks:
|
|
446
446
|
commands:
|
447
447
|
- "./support/bundler_wrapper exec rake test"
|
448
448
|
- "./support/bundler_wrapper exec rake test:failure"
|
449
|
+
- name: Ruby 2.5.8 for rails-6.1
|
450
|
+
env_vars:
|
451
|
+
- *2
|
452
|
+
- *3
|
453
|
+
- *4
|
454
|
+
- *5
|
455
|
+
- name: RUBY_VERSION
|
456
|
+
value: 2.5.8
|
457
|
+
- name: GEMSET
|
458
|
+
value: rails-6.1
|
459
|
+
- name: BUNDLE_GEMFILE
|
460
|
+
value: gemfiles/rails-6.1.gemfile
|
461
|
+
- name: _RUBYGEMS_VERSION
|
462
|
+
value: latest
|
463
|
+
- name: _BUNDLER_VERSION
|
464
|
+
value: latest
|
465
|
+
commands:
|
466
|
+
- "./support/bundler_wrapper exec rake test"
|
467
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
449
468
|
- name: Ruby 2.6.9
|
450
469
|
dependencies:
|
451
470
|
- Validation
|
@@ -683,6 +702,25 @@ blocks:
|
|
683
702
|
commands:
|
684
703
|
- "./support/bundler_wrapper exec rake test"
|
685
704
|
- "./support/bundler_wrapper exec rake test:failure"
|
705
|
+
- name: Ruby 2.6.9 for rails-6.1
|
706
|
+
env_vars:
|
707
|
+
- *2
|
708
|
+
- *3
|
709
|
+
- *4
|
710
|
+
- *5
|
711
|
+
- name: RUBY_VERSION
|
712
|
+
value: 2.6.9
|
713
|
+
- name: GEMSET
|
714
|
+
value: rails-6.1
|
715
|
+
- name: BUNDLE_GEMFILE
|
716
|
+
value: gemfiles/rails-6.1.gemfile
|
717
|
+
- name: _RUBYGEMS_VERSION
|
718
|
+
value: latest
|
719
|
+
- name: _BUNDLER_VERSION
|
720
|
+
value: latest
|
721
|
+
commands:
|
722
|
+
- "./support/bundler_wrapper exec rake test"
|
723
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
686
724
|
- name: Ruby 2.6.9 for resque-1
|
687
725
|
env_vars:
|
688
726
|
- *2
|
@@ -1034,6 +1072,25 @@ blocks:
|
|
1034
1072
|
commands:
|
1035
1073
|
- "./support/bundler_wrapper exec rake test"
|
1036
1074
|
- "./support/bundler_wrapper exec rake test:failure"
|
1075
|
+
- name: Ruby 2.7.5 for rails-6.1
|
1076
|
+
env_vars:
|
1077
|
+
- *2
|
1078
|
+
- *3
|
1079
|
+
- *4
|
1080
|
+
- *5
|
1081
|
+
- name: RUBY_VERSION
|
1082
|
+
value: 2.7.5
|
1083
|
+
- name: GEMSET
|
1084
|
+
value: rails-6.1
|
1085
|
+
- name: BUNDLE_GEMFILE
|
1086
|
+
value: gemfiles/rails-6.1.gemfile
|
1087
|
+
- name: _RUBYGEMS_VERSION
|
1088
|
+
value: latest
|
1089
|
+
- name: _BUNDLER_VERSION
|
1090
|
+
value: latest
|
1091
|
+
commands:
|
1092
|
+
- "./support/bundler_wrapper exec rake test"
|
1093
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
1037
1094
|
- name: Ruby 2.7.5 for rails-7.0
|
1038
1095
|
env_vars:
|
1039
1096
|
- *2
|
@@ -1347,6 +1404,25 @@ blocks:
|
|
1347
1404
|
commands:
|
1348
1405
|
- "./support/bundler_wrapper exec rake test"
|
1349
1406
|
- "./support/bundler_wrapper exec rake test:failure"
|
1407
|
+
- name: Ruby 3.0.3 for rails-6.1
|
1408
|
+
env_vars:
|
1409
|
+
- *2
|
1410
|
+
- *3
|
1411
|
+
- *4
|
1412
|
+
- *5
|
1413
|
+
- name: RUBY_VERSION
|
1414
|
+
value: 3.0.3
|
1415
|
+
- name: GEMSET
|
1416
|
+
value: rails-6.1
|
1417
|
+
- name: BUNDLE_GEMFILE
|
1418
|
+
value: gemfiles/rails-6.1.gemfile
|
1419
|
+
- name: _RUBYGEMS_VERSION
|
1420
|
+
value: latest
|
1421
|
+
- name: _BUNDLER_VERSION
|
1422
|
+
value: latest
|
1423
|
+
commands:
|
1424
|
+
- "./support/bundler_wrapper exec rake test"
|
1425
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
1350
1426
|
- name: Ruby 3.0.3 for rails-7.0
|
1351
1427
|
env_vars:
|
1352
1428
|
- *2
|
@@ -1603,6 +1679,44 @@ blocks:
|
|
1603
1679
|
commands:
|
1604
1680
|
- "./support/bundler_wrapper exec rake test"
|
1605
1681
|
- "./support/bundler_wrapper exec rake test:failure"
|
1682
|
+
- name: Ruby 3.1.0 for rails-6.1
|
1683
|
+
env_vars:
|
1684
|
+
- *2
|
1685
|
+
- *3
|
1686
|
+
- *4
|
1687
|
+
- *5
|
1688
|
+
- name: RUBY_VERSION
|
1689
|
+
value: 3.1.0
|
1690
|
+
- name: GEMSET
|
1691
|
+
value: rails-6.1
|
1692
|
+
- name: BUNDLE_GEMFILE
|
1693
|
+
value: gemfiles/rails-6.1.gemfile
|
1694
|
+
- name: _RUBYGEMS_VERSION
|
1695
|
+
value: latest
|
1696
|
+
- name: _BUNDLER_VERSION
|
1697
|
+
value: latest
|
1698
|
+
commands:
|
1699
|
+
- "./support/bundler_wrapper exec rake test"
|
1700
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
1701
|
+
- name: Ruby 3.1.0 for rails-7.0
|
1702
|
+
env_vars:
|
1703
|
+
- *2
|
1704
|
+
- *3
|
1705
|
+
- *4
|
1706
|
+
- *5
|
1707
|
+
- name: RUBY_VERSION
|
1708
|
+
value: 3.1.0
|
1709
|
+
- name: GEMSET
|
1710
|
+
value: rails-7.0
|
1711
|
+
- name: BUNDLE_GEMFILE
|
1712
|
+
value: gemfiles/rails-7.0.gemfile
|
1713
|
+
- name: _RUBYGEMS_VERSION
|
1714
|
+
value: latest
|
1715
|
+
- name: _BUNDLER_VERSION
|
1716
|
+
value: latest
|
1717
|
+
commands:
|
1718
|
+
- "./support/bundler_wrapper exec rake test"
|
1719
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
1606
1720
|
- name: Ruby 3.1.0 for resque-2
|
1607
1721
|
env_vars:
|
1608
1722
|
- *2
|
@@ -1769,3 +1883,23 @@ blocks:
|
|
1769
1883
|
commands:
|
1770
1884
|
- "./support/bundler_wrapper exec rake test"
|
1771
1885
|
- "./support/bundler_wrapper exec rake test:failure"
|
1886
|
+
- name: Ruby jruby-9.2.19.0 for rails-6.1
|
1887
|
+
env_vars:
|
1888
|
+
- *2
|
1889
|
+
- *3
|
1890
|
+
- *4
|
1891
|
+
- *5
|
1892
|
+
- name: RUBY_VERSION
|
1893
|
+
value: jruby-9.2.19.0
|
1894
|
+
- name: GEMSET
|
1895
|
+
value: rails-6.1
|
1896
|
+
- name: BUNDLE_GEMFILE
|
1897
|
+
value: gemfiles/rails-6.1.gemfile
|
1898
|
+
- name: _RUBYGEMS_VERSION
|
1899
|
+
value: latest
|
1900
|
+
- name: _BUNDLER_VERSION
|
1901
|
+
value: latest
|
1902
|
+
- *6
|
1903
|
+
commands:
|
1904
|
+
- "./support/bundler_wrapper exec rake test"
|
1905
|
+
- "./support/bundler_wrapper exec rake test:failure"
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
2
2
|
|
3
|
+
## 3.0.19
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
|
7
|
+
- [2587eae3](https://github.com/appsignal/appsignal-ruby/commit/2587eae30f17e0f0b5e27cb61982301220cc77b1) patch - Store the extension install report as JSON, instead of YAML. Reduces internal complexity.
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
|
11
|
+
- [243c1ed4](https://github.com/appsignal/appsignal-ruby/commit/243c1ed444f3351ca158200a47836673f851cb31) patch - Improve compatibility with the sequel-rails gem by tracking the performed SQL query in instrumentation events.
|
12
|
+
|
3
13
|
## 3.0.18
|
4
14
|
|
5
15
|
### Added
|
data/build_matrix.yml
CHANGED
@@ -164,6 +164,7 @@ matrix:
|
|
164
164
|
- "no_dependencies"
|
165
165
|
- "rails-5.2"
|
166
166
|
- "rails-6.0"
|
167
|
+
- "rails-6.1"
|
167
168
|
- "rails-7.0"
|
168
169
|
|
169
170
|
ruby:
|
@@ -241,6 +242,13 @@ matrix:
|
|
241
242
|
- "2.3.8"
|
242
243
|
- "2.4.10"
|
243
244
|
- "3.1.0"
|
245
|
+
- gem: "rails-6.1"
|
246
|
+
exclude:
|
247
|
+
ruby:
|
248
|
+
- "2.1.10"
|
249
|
+
- "2.2.10"
|
250
|
+
- "2.3.8"
|
251
|
+
- "2.4.10"
|
244
252
|
- gem: "rails-7.0"
|
245
253
|
exclude:
|
246
254
|
ruby:
|
@@ -250,7 +258,6 @@ matrix:
|
|
250
258
|
- "2.4.10"
|
251
259
|
- "2.5.8"
|
252
260
|
- "2.6.9"
|
253
|
-
- "3.1.0"
|
254
261
|
- "jruby-9.2.19.0"
|
255
262
|
- gem: "resque-1"
|
256
263
|
bundler: "1.17.3"
|
data/ext/base.rb
CHANGED
@@ -2,6 +2,7 @@ require "digest"
|
|
2
2
|
require "fileutils"
|
3
3
|
require "open-uri"
|
4
4
|
require "zlib"
|
5
|
+
require "json"
|
5
6
|
require "yaml"
|
6
7
|
require "rubygems/package"
|
7
8
|
require File.expand_path("../../lib/appsignal/version.rb", __FILE__)
|
@@ -60,7 +61,7 @@ end
|
|
60
61
|
|
61
62
|
def write_report
|
62
63
|
File.open(File.join(EXT_PATH, "install.report"), "w") do |file|
|
63
|
-
file.write
|
64
|
+
file.write JSON.generate(report)
|
64
65
|
end
|
65
66
|
end
|
66
67
|
|
data/gemfiles/rails-7.0.gemfile
CHANGED
@@ -32,20 +32,6 @@ module Appsignal
|
|
32
32
|
|
33
33
|
IO.binread(path, length, offset)
|
34
34
|
end
|
35
|
-
|
36
|
-
def self.parse_yaml(contents)
|
37
|
-
if YAML.respond_to? :safe_load
|
38
|
-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
|
39
|
-
# Use keyword params for Ruby 2.6 and up
|
40
|
-
YAML.safe_load(contents, :permitted_classes => [Time])
|
41
|
-
else
|
42
|
-
YAML.safe_load(contents, [Time])
|
43
|
-
end
|
44
|
-
else
|
45
|
-
# Support for Ruby versions without YAML.safe_load
|
46
|
-
YAML.load(contents) # rubocop:disable Security/YAMLLoad
|
47
|
-
end
|
48
|
-
end
|
49
35
|
end
|
50
36
|
end
|
51
37
|
end
|
@@ -352,8 +352,8 @@ module Appsignal
|
|
352
352
|
def fetch_installation_report
|
353
353
|
path = File.expand_path("../../../../ext/install.report", __FILE__)
|
354
354
|
raw_report = File.read(path)
|
355
|
-
|
356
|
-
rescue StandardError,
|
355
|
+
JSON.parse(raw_report)
|
356
|
+
rescue StandardError, JSON::ParserError => e # rubocop:disable Lint/ShadowedException
|
357
357
|
{
|
358
358
|
"parsing_error" => {
|
359
359
|
"error" => "#{e.class}: #{e}",
|
@@ -411,7 +411,7 @@ module Appsignal
|
|
411
411
|
def print_installation_build_report(report)
|
412
412
|
report = report.fetch("build", {})
|
413
413
|
puts " Build details"
|
414
|
-
puts_format "Install time", report["time"]
|
414
|
+
puts_format "Install time", report["time"], :level => 2
|
415
415
|
puts_format "Architecture", report["architecture"], :level => 2
|
416
416
|
puts_format "Target", report["target"], :level => 2
|
417
417
|
puts_format "Musl override", report["musl_override"], :level => 2
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appsignal
|
4
|
+
class EventFormatter
|
5
|
+
# @api private
|
6
|
+
module Sequel
|
7
|
+
# Compatability with the sequel-rails gem.
|
8
|
+
# The sequel-rails gem adds its own ActiveSupport::Notifications events
|
9
|
+
# that conflict with our own sequel instrumentor. Without this event
|
10
|
+
# formatter the sequel-rails events are recorded without the SQL query
|
11
|
+
# that's being executed.
|
12
|
+
class SqlFormatter
|
13
|
+
def format(payload)
|
14
|
+
[payload[:name].to_s, payload[:sql], SQL_BODY_FORMAT]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Appsignal::EventFormatter.register(
|
22
|
+
"sql.sequel",
|
23
|
+
Appsignal::EventFormatter::Sequel::SqlFormatter
|
24
|
+
)
|
data/lib/appsignal/system.rb
CHANGED
data/lib/appsignal/version.rb
CHANGED
@@ -251,7 +251,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
251
251
|
|
252
252
|
it "adds the installation report to the diagnostics report" do
|
253
253
|
run
|
254
|
-
jruby =
|
254
|
+
jruby = Appsignal::System.jruby?
|
255
255
|
expect(received_report["installation"]).to match(
|
256
256
|
"result" => {
|
257
257
|
"status" => "success"
|
@@ -321,7 +321,7 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
321
321
|
expect(File).to receive(:read)
|
322
322
|
.with(File.expand_path("../../../../../ext/install.report", __FILE__))
|
323
323
|
.and_return(
|
324
|
-
|
324
|
+
JSON.generate(
|
325
325
|
"result" => {
|
326
326
|
"status" => "error",
|
327
327
|
"error" => "RuntimeError: some error",
|
@@ -384,8 +384,8 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
|
|
384
384
|
end
|
385
385
|
end
|
386
386
|
|
387
|
-
context "when report is invalid
|
388
|
-
let(:raw_report) { "
|
387
|
+
context "when report is invalid JSON" do
|
388
|
+
let(:raw_report) { "{}-" }
|
389
389
|
before do
|
390
390
|
allow(File).to receive(:read).and_call_original
|
391
391
|
expect(File).to receive(:read)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
describe Appsignal::EventFormatter::ActiveRecord::
|
2
|
-
let(:klass) {
|
1
|
+
describe Appsignal::EventFormatter::ActiveRecord::SqlFormatter do
|
2
|
+
let(:klass) { described_class }
|
3
3
|
let(:formatter) { klass.new }
|
4
4
|
|
5
5
|
it "should register sql.active_record" do
|
@@ -0,0 +1,30 @@
|
|
1
|
+
describe Appsignal::EventFormatter::Sequel::SqlFormatter do
|
2
|
+
let(:klass) { described_class }
|
3
|
+
let(:formatter) { klass.new }
|
4
|
+
|
5
|
+
it "registers the sql.sequel event formatter" do
|
6
|
+
expect(Appsignal::EventFormatter.registered?("sql.sequel", klass)).to be_truthy
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "#format" do
|
10
|
+
before do
|
11
|
+
stub_const(
|
12
|
+
"SequelDatabaseTypeClass",
|
13
|
+
Class.new do
|
14
|
+
def self.to_s
|
15
|
+
"SequelDatabaseTypeClassToString"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
)
|
19
|
+
end
|
20
|
+
let(:payload) do
|
21
|
+
{
|
22
|
+
:name => SequelDatabaseTypeClass,
|
23
|
+
:sql => "SELECT * FROM users"
|
24
|
+
}
|
25
|
+
end
|
26
|
+
subject { formatter.format(payload) }
|
27
|
+
|
28
|
+
it { is_expected.to eq ["SequelDatabaseTypeClassToString", "SELECT * FROM users", 1] }
|
29
|
+
end
|
30
|
+
end
|
@@ -30,6 +30,7 @@ if DependencyHelper.active_job_present?
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe Appsignal::Hooks::ActiveJobHook::ActiveJobClassInstrumentation do
|
33
|
+
include ActiveJobHelpers
|
33
34
|
let(:time) { Time.parse("2001-01-01 10:00:00UTC") }
|
34
35
|
let(:namespace) { Appsignal::Transaction::BACKGROUND_JOB }
|
35
36
|
let(:queue) { "default" }
|
@@ -65,7 +66,7 @@ if DependencyHelper.active_job_present?
|
|
65
66
|
]
|
66
67
|
end
|
67
68
|
let(:expected_perform_events) do
|
68
|
-
if DependencyHelper.
|
69
|
+
if DependencyHelper.rails7_present?
|
69
70
|
["perform.active_job", "perform_start.active_job"]
|
70
71
|
else
|
71
72
|
["perform_start.active_job", "perform.active_job"]
|
@@ -597,23 +598,5 @@ if DependencyHelper.active_job_present?
|
|
597
598
|
"_aj_symbol_keys"
|
598
599
|
end
|
599
600
|
end
|
600
|
-
|
601
|
-
def active_job_args_wrapper(args: [], params: nil)
|
602
|
-
if DependencyHelper.rails_version >= Gem::Version.new("7.0.0")
|
603
|
-
wrapped_args = {
|
604
|
-
"_aj_ruby2_keywords" => ["args"],
|
605
|
-
"args" => args
|
606
|
-
}
|
607
|
-
|
608
|
-
unless params.nil?
|
609
|
-
wrapped_args["params"] = params
|
610
|
-
wrapped_args["_aj_ruby2_keywords"] = ["params", "args"]
|
611
|
-
end
|
612
|
-
|
613
|
-
[wrapped_args]
|
614
|
-
else
|
615
|
-
params.nil? ? args : args + [params]
|
616
|
-
end
|
617
|
-
end
|
618
601
|
end
|
619
602
|
end
|
@@ -339,6 +339,7 @@ if DependencyHelper.active_job_present?
|
|
339
339
|
require "sidekiq/testing"
|
340
340
|
|
341
341
|
describe "Sidekiq ActiveJob integration" do
|
342
|
+
include ActiveJobHelpers
|
342
343
|
let(:namespace) { Appsignal::Transaction::BACKGROUND_JOB }
|
343
344
|
let(:time) { Time.parse("2001-01-01 10:00:00UTC") }
|
344
345
|
let(:log) { StringIO.new }
|
@@ -367,7 +368,7 @@ if DependencyHelper.active_job_present?
|
|
367
368
|
]
|
368
369
|
end
|
369
370
|
let(:expected_wrapped_args) do
|
370
|
-
if DependencyHelper.
|
371
|
+
if (DependencyHelper.rails6_1_present? && DependencyHelper.ruby_3_1_or_newer?) || DependencyHelper.rails7_present?
|
371
372
|
[{
|
372
373
|
"_aj_ruby2_keywords" => ["args"],
|
373
374
|
"args" => expected_args
|
@@ -385,7 +386,7 @@ if DependencyHelper.active_job_present?
|
|
385
386
|
end
|
386
387
|
end
|
387
388
|
let(:expected_perform_events) do
|
388
|
-
if DependencyHelper.
|
389
|
+
if DependencyHelper.rails7_present?
|
389
390
|
["perform_job.sidekiq", "perform.active_job", "perform_start.active_job"]
|
390
391
|
else
|
391
392
|
["perform_job.sidekiq", "perform_start.active_job", "perform.active_job"]
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -86,8 +86,7 @@ describe Appsignal do
|
|
86
86
|
expect_environment_metadata("ruby_gc_instrumentation_enabled", "true")
|
87
87
|
end
|
88
88
|
|
89
|
-
unless
|
90
|
-
|
89
|
+
unless DependencyHelper.running_jruby?
|
91
90
|
it "installs the allocation event hook" do
|
92
91
|
expect(Appsignal::Extension).to receive(:install_allocation_event_hook)
|
93
92
|
.and_call_original
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ActiveJobHelpers
|
2
|
+
def active_job_args_wrapper(args: [], params: nil)
|
3
|
+
if (DependencyHelper.rails6_1_present? && DependencyHelper.ruby_3_1_or_newer?) || DependencyHelper.rails7_present?
|
4
|
+
wrapped_args = {}
|
5
|
+
|
6
|
+
if params
|
7
|
+
if DependencyHelper.rails7_present?
|
8
|
+
wrapped_args["_aj_ruby2_keywords"] = ["params", "args"]
|
9
|
+
wrapped_args["args"] = []
|
10
|
+
wrapped_args["params"] = {
|
11
|
+
"_aj_symbol_keys" => ["foo"]
|
12
|
+
}.merge(params)
|
13
|
+
else
|
14
|
+
wrapped_args["_aj_symbol_keys"] = ["foo"]
|
15
|
+
wrapped_args.merge!(params)
|
16
|
+
end
|
17
|
+
else
|
18
|
+
wrapped_args["_aj_ruby2_keywords"] = ["args"]
|
19
|
+
wrapped_args["args"] = args
|
20
|
+
end
|
21
|
+
|
22
|
+
[wrapped_args]
|
23
|
+
else
|
24
|
+
params.nil? ? args : args + [params]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -9,8 +9,12 @@ module DependencyHelper
|
|
9
9
|
ruby_version.segments.take(2) == [2, 0]
|
10
10
|
end
|
11
11
|
|
12
|
+
def ruby_3_1_or_newer?
|
13
|
+
ruby_version >= Gem::Version.new("3.1.0")
|
14
|
+
end
|
15
|
+
|
12
16
|
def running_jruby?
|
13
|
-
|
17
|
+
Appsignal::System.jruby?
|
14
18
|
end
|
15
19
|
|
16
20
|
def rails_present?
|
@@ -21,6 +25,14 @@ module DependencyHelper
|
|
21
25
|
rails_present? && rails_version >= Gem::Version.new("6.0.0")
|
22
26
|
end
|
23
27
|
|
28
|
+
def rails6_1_present?
|
29
|
+
rails_present? && rails_version >= Gem::Version.new("6.1.0")
|
30
|
+
end
|
31
|
+
|
32
|
+
def rails7_present?
|
33
|
+
rails_present? && rails_version >= Gem::Version.new("7.0.0")
|
34
|
+
end
|
35
|
+
|
24
36
|
def rails_version
|
25
37
|
Gem.loaded_specs["rails"].version
|
26
38
|
end
|
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: 3.0.
|
4
|
+
version: 3.0.19
|
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: 2022-01-
|
13
|
+
date: 2022-01-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -171,6 +171,7 @@ files:
|
|
171
171
|
- gemfiles/rails-5.1.gemfile
|
172
172
|
- gemfiles/rails-5.2.gemfile
|
173
173
|
- gemfiles/rails-6.0.gemfile
|
174
|
+
- gemfiles/rails-6.1.gemfile
|
174
175
|
- gemfiles/rails-7.0.gemfile
|
175
176
|
- gemfiles/resque-1.gemfile
|
176
177
|
- gemfiles/resque-2.gemfile
|
@@ -199,6 +200,7 @@ files:
|
|
199
200
|
- lib/appsignal/event_formatter/faraday/request_formatter.rb
|
200
201
|
- lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter.rb
|
201
202
|
- lib/appsignal/event_formatter/moped/query_formatter.rb
|
203
|
+
- lib/appsignal/event_formatter/sequel/sql_formatter.rb
|
202
204
|
- lib/appsignal/extension.rb
|
203
205
|
- lib/appsignal/extension/jruby.rb
|
204
206
|
- lib/appsignal/garbage_collection_profiler.rb
|
@@ -297,6 +299,7 @@ files:
|
|
297
299
|
- spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb
|
298
300
|
- spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
|
299
301
|
- spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
|
302
|
+
- spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb
|
300
303
|
- spec/lib/appsignal/event_formatter_spec.rb
|
301
304
|
- spec/lib/appsignal/extension/jruby_spec.rb
|
302
305
|
- spec/lib/appsignal/extension_install_failure_spec.rb
|
@@ -368,6 +371,7 @@ files:
|
|
368
371
|
- spec/support/fixtures/projects/valid/log/.gitkeep
|
369
372
|
- spec/support/fixtures/uploaded_file.txt
|
370
373
|
- spec/support/helpers/action_mailer_helpers.rb
|
374
|
+
- spec/support/helpers/activejob_helpers.rb
|
371
375
|
- spec/support/helpers/api_request_helper.rb
|
372
376
|
- spec/support/helpers/cli_helpers.rb
|
373
377
|
- spec/support/helpers/config_helpers.rb
|
@@ -448,6 +452,7 @@ test_files:
|
|
448
452
|
- spec/lib/appsignal/event_formatter/faraday/request_formatter_spec.rb
|
449
453
|
- spec/lib/appsignal/event_formatter/mongo_ruby_driver/query_formatter_spec.rb
|
450
454
|
- spec/lib/appsignal/event_formatter/moped/query_formatter_spec.rb
|
455
|
+
- spec/lib/appsignal/event_formatter/sequel/sql_formatter_spec.rb
|
451
456
|
- spec/lib/appsignal/event_formatter_spec.rb
|
452
457
|
- spec/lib/appsignal/extension/jruby_spec.rb
|
453
458
|
- spec/lib/appsignal/extension_install_failure_spec.rb
|
@@ -519,6 +524,7 @@ test_files:
|
|
519
524
|
- spec/support/fixtures/projects/valid/log/.gitkeep
|
520
525
|
- spec/support/fixtures/uploaded_file.txt
|
521
526
|
- spec/support/helpers/action_mailer_helpers.rb
|
527
|
+
- spec/support/helpers/activejob_helpers.rb
|
522
528
|
- spec/support/helpers/api_request_helper.rb
|
523
529
|
- spec/support/helpers/cli_helpers.rb
|
524
530
|
- spec/support/helpers/config_helpers.rb
|