appsignal 3.9.2-java → 3.9.3-java
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 +4 -4
- data/.github/workflows/ci.yml +3135 -0
- data/.rubocop.yml +28 -20
- data/.rubocop_todo.yml +7 -33
- data/CHANGELOG.md +38 -0
- data/Rakefile +79 -64
- data/appsignal.gemspec +1 -1
- data/build_matrix.yml +109 -179
- data/ext/base.rb +1 -1
- data/gemfiles/hanami-2.1.gemfile +7 -0
- data/lib/appsignal/cli/diagnose.rb +1 -1
- data/lib/appsignal/config.rb +1 -1
- data/lib/appsignal/demo.rb +0 -1
- data/lib/appsignal/environment.rb +5 -1
- data/lib/appsignal/extension/jruby.rb +1 -1
- data/lib/appsignal/helpers/instrumentation.rb +1 -1
- data/lib/appsignal/integrations/grape.rb +19 -47
- data/lib/appsignal/integrations/hanami.rb +8 -7
- data/lib/appsignal/integrations/padrino.rb +46 -43
- data/lib/appsignal/integrations/railtie.rb +0 -3
- data/lib/appsignal/integrations/sinatra.rb +0 -1
- data/lib/appsignal/probes/gvl.rb +24 -2
- data/lib/appsignal/probes/sidekiq.rb +1 -1
- data/lib/appsignal/probes.rb +1 -1
- data/lib/appsignal/rack/abstract_middleware.rb +62 -28
- data/lib/appsignal/rack/event_handler.rb +12 -3
- data/lib/appsignal/rack/grape_middleware.rb +40 -0
- data/lib/appsignal/rack/hanami_middleware.rb +1 -11
- data/lib/appsignal/rack/rails_instrumentation.rb +14 -55
- data/lib/appsignal/utils/integration_memory_logger.rb +78 -0
- data/lib/appsignal/utils.rb +1 -0
- data/lib/appsignal/version.rb +1 -1
- data/lib/appsignal.rb +34 -33
- data/spec/.rubocop.yml +1 -1
- data/spec/lib/appsignal/cli/diagnose_spec.rb +1 -1
- data/spec/lib/appsignal/cli/install_spec.rb +3 -3
- data/spec/lib/appsignal/config_spec.rb +7 -5
- data/spec/lib/appsignal/demo_spec.rb +38 -41
- data/spec/lib/appsignal/hooks/action_cable_spec.rb +86 -167
- data/spec/lib/appsignal/hooks/active_support_notifications/finish_with_state_shared_examples.rb +8 -20
- data/spec/lib/appsignal/hooks/active_support_notifications/instrument_shared_examples.rb +38 -84
- data/spec/lib/appsignal/hooks/active_support_notifications/start_finish_shared_examples.rb +16 -37
- data/spec/lib/appsignal/hooks/active_support_notifications_spec.rb +4 -4
- data/spec/lib/appsignal/hooks/activejob_spec.rb +111 -200
- data/spec/lib/appsignal/hooks/delayed_job_spec.rb +54 -91
- data/spec/lib/appsignal/hooks/dry_monitor_spec.rb +14 -32
- data/spec/lib/appsignal/hooks/excon_spec.rb +8 -12
- data/spec/lib/appsignal/hooks/net_http_spec.rb +7 -42
- data/spec/lib/appsignal/hooks/rake_spec.rb +9 -19
- data/spec/lib/appsignal/hooks/redis_client_spec.rb +18 -30
- data/spec/lib/appsignal/hooks/redis_spec.rb +10 -16
- data/spec/lib/appsignal/hooks/resque_spec.rb +42 -62
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +33 -74
- data/spec/lib/appsignal/integrations/hanami_spec.rb +79 -21
- data/spec/lib/appsignal/integrations/http_spec.rb +12 -20
- data/spec/lib/appsignal/integrations/net_http_spec.rb +33 -0
- data/spec/lib/appsignal/integrations/object_spec.rb +29 -36
- data/spec/lib/appsignal/integrations/padrino_spec.rb +47 -70
- data/spec/lib/appsignal/integrations/que_spec.rb +43 -70
- data/spec/lib/appsignal/integrations/railtie_spec.rb +26 -67
- data/spec/lib/appsignal/integrations/sidekiq_spec.rb +86 -160
- data/spec/lib/appsignal/integrations/sinatra_spec.rb +0 -1
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +28 -39
- data/spec/lib/appsignal/probes/gvl_spec.rb +80 -3
- data/spec/lib/appsignal/probes_spec.rb +7 -4
- data/spec/lib/appsignal/rack/abstract_middleware_spec.rb +215 -106
- data/spec/lib/appsignal/rack/event_handler_spec.rb +81 -78
- data/spec/lib/appsignal/rack/generic_instrumentation_spec.rb +2 -12
- data/spec/lib/appsignal/rack/grape_middleware_spec.rb +234 -0
- data/spec/lib/appsignal/rack/hanami_middleware_spec.rb +2 -16
- data/spec/lib/appsignal/rack/rails_instrumentation_spec.rb +67 -131
- data/spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb +36 -44
- data/spec/lib/appsignal/rack/streaming_listener_spec.rb +68 -86
- data/spec/lib/appsignal/transaction_spec.rb +76 -90
- data/spec/lib/appsignal/utils/integration_memory_logger_spec.rb +163 -0
- data/spec/lib/appsignal_spec.rb +363 -342
- data/spec/support/helpers/dependency_helper.rb +6 -1
- data/spec/support/helpers/std_streams_helper.rb +1 -1
- data/spec/support/helpers/transaction_helpers.rb +8 -0
- data/spec/support/matchers/transaction.rb +185 -0
- data/spec/support/mocks/dummy_app.rb +20 -0
- data/spec/support/shared_examples/instrument.rb +17 -12
- data/spec/support/testing.rb +18 -9
- metadata +15 -10
- data/.semaphore/semaphore.yml +0 -2347
- data/script/lint_git +0 -22
- data/spec/lib/appsignal/integrations/grape_spec.rb +0 -239
- data/spec/support/matchers/be_completed.rb +0 -5
- /data/gemfiles/{hanami.gemfile → hanami-2.0.gemfile} +0 -0
data/.rubocop.yml
CHANGED
|
@@ -51,6 +51,20 @@ Style/Lambda:
|
|
|
51
51
|
Style/WordArray:
|
|
52
52
|
Enabled: false
|
|
53
53
|
|
|
54
|
+
Style/FrozenStringLiteralComment:
|
|
55
|
+
Enabled: true
|
|
56
|
+
Exclude:
|
|
57
|
+
- "spec/**/*.rb"
|
|
58
|
+
|
|
59
|
+
Style/NumericPredicate:
|
|
60
|
+
Enabled: false
|
|
61
|
+
|
|
62
|
+
Style/SymbolArray:
|
|
63
|
+
EnforcedStyle: brackets
|
|
64
|
+
|
|
65
|
+
Style/RedundantConstantBase:
|
|
66
|
+
Enabled: false
|
|
67
|
+
|
|
54
68
|
Lint/ConstantDefinitionInBlock:
|
|
55
69
|
Exclude:
|
|
56
70
|
- "spec/**/*.rb"
|
|
@@ -59,6 +73,10 @@ Lint/EmptyClass:
|
|
|
59
73
|
Exclude:
|
|
60
74
|
- "spec/**/*.rb"
|
|
61
75
|
|
|
76
|
+
Lint/EmptyFile:
|
|
77
|
+
Exclude:
|
|
78
|
+
- "spec/**/*.rb"
|
|
79
|
+
|
|
62
80
|
Layout/HashAlignment:
|
|
63
81
|
EnforcedLastArgumentHashStyle: ignore_implicit
|
|
64
82
|
|
|
@@ -83,20 +101,27 @@ Layout/MultilineMethodCallIndentation:
|
|
|
83
101
|
Layout/MultilineOperationIndentation:
|
|
84
102
|
EnforcedStyle: indented
|
|
85
103
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
- "spec/**/*.rb"
|
|
104
|
+
Layout/LineLength:
|
|
105
|
+
Max: 100
|
|
89
106
|
|
|
90
107
|
Naming/FileName:
|
|
91
108
|
Exclude:
|
|
92
109
|
- "ext/Rakefile"
|
|
93
110
|
|
|
111
|
+
Naming/AccessorMethodName:
|
|
112
|
+
Exclude:
|
|
113
|
+
- "lib/appsignal/helpers/instrumentation.rb"
|
|
114
|
+
- "lib/appsignal/transaction.rb"
|
|
115
|
+
|
|
94
116
|
Naming/RescuedExceptionsVariableName:
|
|
95
117
|
Enabled: false
|
|
96
118
|
|
|
97
119
|
Naming/VariableNumber:
|
|
98
120
|
Enabled: false
|
|
99
121
|
|
|
122
|
+
Metrics/ModuleLength:
|
|
123
|
+
Enabled: false
|
|
124
|
+
|
|
100
125
|
Metrics/ClassLength:
|
|
101
126
|
Enabled: false
|
|
102
127
|
|
|
@@ -104,22 +129,5 @@ Metrics/BlockLength:
|
|
|
104
129
|
Exclude:
|
|
105
130
|
- "Rakefile"
|
|
106
131
|
|
|
107
|
-
Style/FrozenStringLiteralComment:
|
|
108
|
-
Enabled: true
|
|
109
|
-
Exclude:
|
|
110
|
-
- "spec/**/*.rb"
|
|
111
|
-
|
|
112
|
-
Style/NumericPredicate:
|
|
113
|
-
Enabled: false
|
|
114
|
-
|
|
115
|
-
Style/SymbolArray:
|
|
116
|
-
EnforcedStyle: brackets
|
|
117
|
-
|
|
118
|
-
Style/RedundantConstantBase:
|
|
119
|
-
Enabled: false
|
|
120
|
-
|
|
121
132
|
Gemspec/DevelopmentDependencies:
|
|
122
133
|
Enabled: false
|
|
123
|
-
|
|
124
|
-
Layout/LineLength:
|
|
125
|
-
Max: 100
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,66 +1,49 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2024-06-27 09:42:06 UTC using RuboCop version 1.64.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
-
# Offense count: 3
|
|
10
|
-
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
|
12
|
-
# URISchemes: http, https
|
|
13
|
-
Layout/LineLength:
|
|
14
|
-
Max: 112
|
|
15
|
-
|
|
16
9
|
# Offense count: 2
|
|
10
|
+
# Configuration parameters: AllowedParentClasses.
|
|
17
11
|
Lint/MissingSuper:
|
|
18
12
|
Exclude:
|
|
19
13
|
- 'lib/appsignal/extension.rb'
|
|
20
14
|
- 'lib/appsignal/logger.rb'
|
|
21
15
|
|
|
22
|
-
# Offense count: 1
|
|
23
|
-
Lint/NoReturnInBeginEndBlocks:
|
|
24
|
-
Exclude:
|
|
25
|
-
- 'lib/appsignal/environment.rb'
|
|
26
|
-
|
|
27
16
|
# Offense count: 1
|
|
28
17
|
Lint/StructNewOverride:
|
|
29
18
|
Exclude:
|
|
30
19
|
- 'spec/lib/appsignal/probes/sidekiq_spec.rb'
|
|
31
20
|
|
|
32
|
-
# Offense count:
|
|
21
|
+
# Offense count: 63
|
|
33
22
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
34
23
|
Metrics/AbcSize:
|
|
35
24
|
Max: 44
|
|
36
25
|
|
|
37
|
-
# Offense count:
|
|
26
|
+
# Offense count: 6
|
|
38
27
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
39
28
|
# AllowedMethods: refine
|
|
40
29
|
Metrics/BlockLength:
|
|
41
30
|
Max: 31
|
|
42
31
|
|
|
43
|
-
# Offense count:
|
|
32
|
+
# Offense count: 21
|
|
44
33
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
45
34
|
Metrics/CyclomaticComplexity:
|
|
46
35
|
Max: 11
|
|
47
36
|
|
|
48
|
-
# Offense count:
|
|
37
|
+
# Offense count: 139
|
|
49
38
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
50
39
|
Metrics/MethodLength:
|
|
51
40
|
Max: 56
|
|
52
41
|
|
|
53
|
-
# Offense count:
|
|
42
|
+
# Offense count: 18
|
|
54
43
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
55
44
|
Metrics/PerceivedComplexity:
|
|
56
45
|
Max: 13
|
|
57
46
|
|
|
58
|
-
# Offense count: 7
|
|
59
|
-
Naming/AccessorMethodName:
|
|
60
|
-
Exclude:
|
|
61
|
-
- 'lib/appsignal/helpers/instrumentation.rb'
|
|
62
|
-
- 'lib/appsignal/transaction.rb'
|
|
63
|
-
|
|
64
47
|
# Offense count: 2
|
|
65
48
|
Security/Open:
|
|
66
49
|
Exclude:
|
|
@@ -82,15 +65,6 @@ Style/Alias:
|
|
|
82
65
|
- 'lib/appsignal/helpers/instrumentation.rb'
|
|
83
66
|
- 'lib/appsignal/transaction.rb'
|
|
84
67
|
|
|
85
|
-
# Offense count: 2
|
|
86
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
87
|
-
# Configuration parameters: EnforcedStyle.
|
|
88
|
-
# SupportedStyles: nested, compact
|
|
89
|
-
Style/ClassAndModuleChildren:
|
|
90
|
-
Exclude:
|
|
91
|
-
- 'lib/appsignal/integrations/hanami.rb'
|
|
92
|
-
- 'lib/appsignal/integrations/padrino.rb'
|
|
93
|
-
|
|
94
68
|
# Offense count: 1
|
|
95
69
|
Style/ClassVars:
|
|
96
70
|
Exclude:
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# AppSignal for Ruby gem Changelog
|
|
2
2
|
|
|
3
|
+
## 3.9.3
|
|
4
|
+
|
|
5
|
+
_Published on 2024-07-02._
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- [0230ab4d](https://github.com/appsignal/appsignal-ruby/commit/0230ab4da00d75e4fc72fd493fc98441b5d7254d) patch - Track error response status for web requests. When an unhandled exception reaches the AppSignal EventHandler instrumentation, report the response status as `500` for the `response_status` tag on the transaction and on the `response_status` metric.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- [b3a80038](https://github.com/appsignal/appsignal-ruby/commit/b3a800380c0d83422d7f3c0e9c93551d343c50c0) patch - Require the AppSignal gem in the Grape integration file. Previously `require "appsignal"` had to be called before `require "appsignal/integrations/grape"`. This `require "appsignal"` is no longer required.
|
|
14
|
+
- [e9aa0603](https://github.com/appsignal/appsignal-ruby/commit/e9aa06031b6c17f9f2704250bb1775a4cb72b276) patch - Report Global VM Lock metrics per process. In addition to the existing `hostname` tag, add `process_name` and `process_id` tags to the `gvl_global_timer` and `gvl_waiting_threads` metrics emitted by the [GVL probe](https://docs.appsignal.com/ruby/integrations/global-vm-lock.html), allowing these metrics to be tracked in a per-process basis.
|
|
15
|
+
|
|
16
|
+
### Deprecated
|
|
17
|
+
|
|
18
|
+
- [844aa0af](https://github.com/appsignal/appsignal-ruby/commit/844aa0afa3311860dca84badc27c2be8996bfd3c) patch - Deprecate `Appsignal::Grape::Middleware` constant in favor of `Appsignal::Rack::GrapeMiddleware` constant.
|
|
19
|
+
|
|
20
|
+
To fix this deprecation warning, update the usage of `Appsignal::Grape::Middleware` like this:
|
|
21
|
+
|
|
22
|
+
```ruby
|
|
23
|
+
# Grape only apps
|
|
24
|
+
insert_before Grape::Middleware::Error, Appsignal::Rack::GrapeMiddleware
|
|
25
|
+
# or
|
|
26
|
+
use Appsignal::Rack::GrapeMiddleware
|
|
27
|
+
|
|
28
|
+
# Grape on Rails app
|
|
29
|
+
use Appsignal::Rack::GrapeMiddleware
|
|
30
|
+
```
|
|
31
|
+
- [1f648ab4](https://github.com/appsignal/appsignal-ruby/commit/1f648ab4d0372f37d15a980a9902779834811531) patch - Deprecate the `Appsignal.start_logger` method. Remove this method call from apps if it is present. Calling `Appsignal.start` will now initialize the logger.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- [0bb29809](https://github.com/appsignal/appsignal-ruby/commit/0bb29809f1750bdac2b66a1132a3638c58e6d1f8) patch - Fix an issue with invalid request methods raising an error in the GenericInstrumentation middleware when using a request class that throws an error when calling the `request_method` method, like `ActionDispatch::Request`.
|
|
36
|
+
- [66bb7a60](https://github.com/appsignal/appsignal-ruby/commit/66bb7a60cafd3fb1a91d4ed0430d51ee8ac8de46) patch - Support Grape apps that are nested in other apps like Sinatra and Rails, that also include AppSignal middleware for instrumentation.
|
|
37
|
+
- [a7b056bd](https://github.com/appsignal/appsignal-ruby/commit/a7b056bd333912b3b6388d68d6dd3af0b2cb9a75) patch - Support Hanami version 2.1. On older versions of our Ruby gem it would error on an unknown keyword argument "sessions_enabled".
|
|
38
|
+
- [00b7ac6a](https://github.com/appsignal/appsignal-ruby/commit/00b7ac6a9128d47fa9d3a1556f73a14304de8944) patch - Fix issue with AppSignal getting stuck in a boot loop when loading the Hanami integration with: `require "appsignal/integrations/hanami"`
|
|
39
|
+
This could happen in nested applications, like a Hanami app in a Rails app. It will now use the first config AppSignal starts with.
|
|
40
|
+
|
|
3
41
|
## 3.9.2
|
|
4
42
|
|
|
5
43
|
_Published on 2024-06-26._
|
data/Rakefile
CHANGED
|
@@ -20,98 +20,113 @@ VERSION_MANAGERS = {
|
|
|
20
20
|
}
|
|
21
21
|
}.freeze
|
|
22
22
|
|
|
23
|
-
def
|
|
23
|
+
def build_job(ruby_version, ruby_gem = nil)
|
|
24
24
|
{
|
|
25
|
-
"name" =>
|
|
26
|
-
"
|
|
25
|
+
"name" => "Ruby #{ruby_version}#{" - #{ruby_gem}" if ruby_gem}",
|
|
26
|
+
"needs" => "validation",
|
|
27
|
+
"runs-on" => "ubuntu-latest",
|
|
28
|
+
"steps" => [
|
|
29
|
+
{
|
|
30
|
+
"name" => "Check out repository",
|
|
31
|
+
"uses" => "actions/checkout@v4"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name" => "Install Ruby",
|
|
35
|
+
"uses" => "ruby/setup-ruby@v1",
|
|
36
|
+
"with" => {
|
|
37
|
+
"ruby-version" => ruby_version,
|
|
38
|
+
"bundler-cache" => true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name" => "Install gem extension",
|
|
43
|
+
"run" => "./support/bundler_wrapper exec rake extension:install"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name" => "Print extension install report",
|
|
47
|
+
"run" => "[ -e ext/install.report ] && cat ext/install.report || echo 'No ext/install.report file found'" # rubocop:disable Layout/LineLength
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name" => "Print Makefile log file",
|
|
51
|
+
"run" => "[ -f ext/mkmf.log ] && cat ext/mkmf.log || echo 'No ext/mkmf.log file found'"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
27
54
|
}
|
|
28
55
|
end
|
|
29
56
|
|
|
30
|
-
def
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"task" => {
|
|
35
|
-
"prologue" => matrix["prologue"].merge(
|
|
36
|
-
"commands" => matrix["prologue"]["commands"] + [
|
|
37
|
-
"./support/bundler_wrapper exec rake extension:install",
|
|
38
|
-
"[ -e ext/install.report ] && cat ext/install.report || echo 'No ext/install.report file found'", # rubocop:disable Metrics/LineLength
|
|
39
|
-
"[ -f ext/mkmf.log ] && cat ext/mkmf.log || echo 'No ext/mkmf.log file found'"
|
|
40
|
-
]
|
|
41
|
-
),
|
|
42
|
-
"epilogue" => matrix["epilogue"],
|
|
43
|
-
"jobs" => []
|
|
44
|
-
}
|
|
45
|
-
}
|
|
57
|
+
def build_matrix_key(ruby_version, ruby_gem = nil)
|
|
58
|
+
base = "ruby_#{ruby_version}"
|
|
59
|
+
base = "#{base}__#{ruby_gem}" if ruby_gem
|
|
60
|
+
base.downcase.gsub(/\W/, "-")
|
|
46
61
|
end
|
|
47
62
|
|
|
48
63
|
def gems_with_gemfiles
|
|
49
64
|
YAML.load_file("build_matrix.yml")["matrix"]["gems"].map { |g| g["gem"] }.freeze
|
|
50
65
|
end
|
|
51
66
|
|
|
67
|
+
GITHUB_ACTION_WORKFLOW_FILE = ".github/workflows/ci.yml"
|
|
68
|
+
|
|
52
69
|
namespace :build_matrix do
|
|
53
|
-
namespace :
|
|
70
|
+
namespace :github do
|
|
54
71
|
task :generate do
|
|
55
72
|
yaml = YAML.load_file("build_matrix.yml")
|
|
56
73
|
matrix = yaml["matrix"]
|
|
57
|
-
|
|
58
|
-
semaphore = yaml["semaphore"]
|
|
74
|
+
github = yaml["github"]
|
|
59
75
|
|
|
60
|
-
builds =
|
|
76
|
+
builds = {}
|
|
61
77
|
matrix["ruby"].each do |ruby|
|
|
62
78
|
ruby_version = ruby["ruby"]
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
job = {
|
|
81
|
-
"name" => "Ruby #{ruby_version} for #{gem["gem"]}",
|
|
82
|
-
"env_vars" => env + ruby.fetch("env_vars", []),
|
|
83
|
-
"commands" => [
|
|
84
|
-
"./support/bundler_wrapper exec rake test"
|
|
85
|
-
]
|
|
79
|
+
gemset_for_ruby(ruby, matrix).each do |ruby_gem|
|
|
80
|
+
next unless included_for_ruby?(matrix, ruby_gem, ruby)
|
|
81
|
+
|
|
82
|
+
is_primary_job = ruby_gem["gem"] == "no_dependencies"
|
|
83
|
+
job =
|
|
84
|
+
if is_primary_job
|
|
85
|
+
build_job(ruby_version)
|
|
86
|
+
else
|
|
87
|
+
build_job(ruby_version, ruby_gem["gem"])
|
|
88
|
+
end
|
|
89
|
+
job["env"] = matrix["env"]
|
|
90
|
+
.merge("BUNDLE_GEMFILE" => "gemfiles/#{ruby_gem["gem"]}.gemfile")
|
|
91
|
+
|
|
92
|
+
test_step = {
|
|
93
|
+
"name" => "Run tests",
|
|
94
|
+
"run" => "./support/bundler_wrapper exec rake test"
|
|
86
95
|
}
|
|
87
|
-
|
|
96
|
+
|
|
97
|
+
if is_primary_job
|
|
98
|
+
job["steps"] << test_step
|
|
88
99
|
# Only test the failure scenarios once per Ruby version
|
|
89
|
-
job["
|
|
90
|
-
|
|
100
|
+
job["steps"] << {
|
|
101
|
+
"name" => "Run tests without extension",
|
|
102
|
+
"run" => "./support/bundler_wrapper exec rake test:failure"
|
|
103
|
+
}
|
|
104
|
+
builds[build_matrix_key(ruby["ruby"])] = job
|
|
91
105
|
else
|
|
92
|
-
|
|
106
|
+
job["needs"] = build_matrix_key(ruby["ruby"])
|
|
107
|
+
job["steps"] << test_step
|
|
108
|
+
builds[build_matrix_key(ruby["ruby"], ruby_gem["gem"])] = job
|
|
93
109
|
end
|
|
94
110
|
end
|
|
95
|
-
builds << ruby_primary_block
|
|
96
|
-
builds << ruby_secondary_block if ruby_secondary_block["task"]["jobs"].count.nonzero?
|
|
97
111
|
end
|
|
98
|
-
|
|
112
|
+
github["jobs"] = github["jobs"].merge(builds)
|
|
99
113
|
|
|
114
|
+
job_count = github["jobs"].count
|
|
100
115
|
header = "# DO NOT EDIT\n" \
|
|
101
|
-
"# This is a generated file by the `rake build_matrix:
|
|
116
|
+
"# This is a generated file by the `rake build_matrix:github:generate` task.\n" \
|
|
102
117
|
"# See `build_matrix.yml` for the build matrix.\n" \
|
|
103
|
-
"# Generate this file with `rake build_matrix:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
puts "
|
|
108
|
-
puts "Job count: #{
|
|
118
|
+
"# Generate this file with `rake build_matrix:github:generate`.\n" \
|
|
119
|
+
"# Generated job count: #{job_count}\n"
|
|
120
|
+
generated_yaml = header + YAML.dump(github)
|
|
121
|
+
File.write(GITHUB_ACTION_WORKFLOW_FILE, generated_yaml)
|
|
122
|
+
puts "Generated `#{GITHUB_ACTION_WORKFLOW_FILE}`"
|
|
123
|
+
puts "Job count: #{job_count}"
|
|
109
124
|
end
|
|
110
125
|
|
|
111
126
|
task :validate => :generate do
|
|
112
127
|
output = `git status`
|
|
113
|
-
if output.include?
|
|
114
|
-
puts "The
|
|
128
|
+
if output.include? GITHUB_ACTION_WORKFLOW_FILE
|
|
129
|
+
puts "The `#{GITHUB_ACTION_WORKFLOW_FILE}` is modified. The changes were not committed."
|
|
115
130
|
puts "Please run `rake build_matrix:semaphore:generate` and commit the changes."
|
|
116
131
|
exit 1
|
|
117
132
|
end
|
|
@@ -191,11 +206,11 @@ namespace :build_matrix do
|
|
|
191
206
|
if included_rubies.any?
|
|
192
207
|
# If this gem only runs on these specific Ruby version
|
|
193
208
|
included_rubies.each { |version| check_if_ruby_version_exists!(matrix, version) }
|
|
194
|
-
|
|
209
|
+
true if included_rubies.include?(ruby["ruby"])
|
|
195
210
|
else
|
|
196
211
|
# If this gem is excluded from running on this Ruby version
|
|
197
212
|
excluded_rubies.each { |version| check_if_ruby_version_exists!(matrix, version) }
|
|
198
|
-
|
|
213
|
+
true unless excluded_rubies.include?(ruby["ruby"])
|
|
199
214
|
end
|
|
200
215
|
end
|
|
201
216
|
|
data/appsignal.gemspec
CHANGED
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
|
|
|
40
40
|
gem.add_development_dependency "pry"
|
|
41
41
|
gem.add_development_dependency "rake", ">= 12"
|
|
42
42
|
gem.add_development_dependency "rspec", "~> 3.8"
|
|
43
|
-
gem.add_development_dependency "rubocop", "1.
|
|
43
|
+
gem.add_development_dependency "rubocop", "1.64.1"
|
|
44
44
|
gem.add_development_dependency "timecop"
|
|
45
45
|
gem.add_development_dependency "webmock"
|
|
46
46
|
gem.add_development_dependency "yard", ">= 0.9.20"
|