appsignal 2.11.1-java → 3.0.0.beta.1-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/.rubocop.yml +6 -1
- data/.semaphore/semaphore.yml +197 -23
- data/CHANGELOG.md +25 -0
- data/README.md +9 -0
- data/Rakefile +9 -6
- data/build_matrix.yml +13 -4
- data/ext/agent.yml +17 -17
- data/ext/base.rb +12 -9
- data/gemfiles/no_dependencies.gemfile +7 -0
- data/gemfiles/resque-2.gemfile +0 -1
- data/gemfiles/webmachine.gemfile +1 -0
- data/lib/appsignal.rb +1 -27
- data/lib/appsignal/auth_check.rb +2 -8
- data/lib/appsignal/cli.rb +1 -23
- data/lib/appsignal/cli/diagnose/utils.rb +8 -11
- data/lib/appsignal/cli/install.rb +5 -8
- data/lib/appsignal/config.rb +0 -24
- data/lib/appsignal/event_formatter.rb +0 -25
- data/lib/appsignal/helpers/instrumentation.rb +32 -0
- data/lib/appsignal/hooks.rb +0 -23
- data/lib/appsignal/hooks/action_cable.rb +3 -34
- data/lib/appsignal/hooks/active_support_notifications.rb +7 -86
- data/lib/appsignal/hooks/celluloid.rb +5 -9
- data/lib/appsignal/hooks/net_http.rb +2 -12
- data/lib/appsignal/hooks/puma.rb +3 -5
- data/lib/appsignal/hooks/que.rb +1 -1
- data/lib/appsignal/hooks/rake.rb +2 -24
- data/lib/appsignal/hooks/redis.rb +2 -13
- data/lib/appsignal/hooks/resque.rb +2 -43
- data/lib/appsignal/hooks/shoryuken.rb +43 -4
- data/lib/appsignal/hooks/unicorn.rb +3 -24
- data/lib/appsignal/hooks/webmachine.rb +1 -7
- data/lib/appsignal/integrations/action_cable.rb +34 -0
- data/lib/appsignal/integrations/active_support_notifications.rb +77 -0
- data/lib/appsignal/integrations/net_http.rb +16 -0
- data/lib/appsignal/integrations/object.rb +44 -17
- data/lib/appsignal/integrations/padrino.rb +5 -7
- data/lib/appsignal/integrations/que.rb +26 -33
- data/lib/appsignal/integrations/railtie.rb +1 -4
- data/lib/appsignal/integrations/rake.rb +26 -2
- data/lib/appsignal/integrations/redis.rb +17 -0
- data/lib/appsignal/integrations/resque.rb +39 -10
- data/lib/appsignal/integrations/unicorn.rb +28 -0
- data/lib/appsignal/integrations/webmachine.rb +22 -24
- data/lib/appsignal/minutely.rb +0 -12
- data/lib/appsignal/system.rb +4 -0
- data/lib/appsignal/transaction.rb +30 -2
- data/lib/appsignal/version.rb +1 -1
- data/spec/lib/appsignal/auth_check_spec.rb +1 -24
- data/spec/lib/appsignal/cli_spec.rb +1 -1
- data/spec/lib/appsignal/config_spec.rb +0 -66
- data/spec/lib/appsignal/event_formatter_spec.rb +0 -37
- data/spec/lib/appsignal/hooks/celluloid_spec.rb +6 -1
- data/spec/lib/appsignal/hooks/rake_spec.rb +1 -2
- data/spec/lib/appsignal/hooks/redis_spec.rb +50 -15
- data/spec/lib/appsignal/hooks/resque_spec.rb +10 -2
- data/spec/lib/appsignal/hooks/shoryuken_spec.rb +151 -104
- data/spec/lib/appsignal/hooks/sidekiq_spec.rb +4 -2
- data/spec/lib/appsignal/hooks/unicorn_spec.rb +14 -3
- data/spec/lib/appsignal/hooks/webmachine_spec.rb +2 -13
- data/spec/lib/appsignal/hooks_spec.rb +0 -57
- data/spec/lib/appsignal/integrations/object_spec.rb +25 -10
- data/spec/lib/appsignal/integrations/padrino_spec.rb +2 -3
- data/spec/lib/appsignal/integrations/railtie_spec.rb +0 -45
- data/spec/lib/appsignal/integrations/webmachine_spec.rb +26 -8
- data/spec/lib/appsignal/minutely_spec.rb +0 -19
- data/spec/lib/appsignal/transaction_spec.rb +56 -14
- data/spec/lib/appsignal/transmitter_spec.rb +1 -1
- data/spec/lib/appsignal_spec.rb +30 -69
- data/spec/spec_helper.rb +1 -15
- metadata +13 -22
- data/lib/appsignal/cli/notify_of_deploy.rb +0 -131
- data/lib/appsignal/integrations/resque_active_job.rb +0 -19
- data/lib/appsignal/js_exception_transaction.rb +0 -56
- data/lib/appsignal/rack/js_exception_catcher.rb +0 -80
- data/spec/lib/appsignal/cli/notify_of_deploy_spec.rb +0 -180
- data/spec/lib/appsignal/integrations/resque_active_job_spec.rb +0 -28
- data/spec/lib/appsignal/integrations/resque_spec.rb +0 -28
- data/spec/lib/appsignal/js_exception_transaction_spec.rb +0 -128
- data/spec/lib/appsignal/rack/js_exception_catcher_spec.rb +0 -170
@@ -143,7 +143,7 @@ describe Appsignal::Transmitter do
|
|
143
143
|
context "with a proxy" do
|
144
144
|
let(:config) { project_fixture_config("production", :http_proxy => "http://localhost:8080") }
|
145
145
|
|
146
|
-
it "is of Net::HTTP class"
|
146
|
+
it "is of Net::HTTP class" do
|
147
147
|
expect(subject).to be_instance_of(Net::HTTP)
|
148
148
|
end
|
149
149
|
it { expect(subject.proxy?).to be_truthy }
|
data/spec/lib/appsignal_spec.rb
CHANGED
@@ -63,11 +63,6 @@ describe Appsignal do
|
|
63
63
|
Appsignal.start
|
64
64
|
end
|
65
65
|
|
66
|
-
it "should load deprecated event formatters" do
|
67
|
-
expect(Appsignal::EventFormatter).to receive(:initialize_deprecated_formatters)
|
68
|
-
Appsignal.start
|
69
|
-
end
|
70
|
-
|
71
66
|
context "with an extension" do
|
72
67
|
before { Appsignal.extensions << Appsignal::MockExtension }
|
73
68
|
|
@@ -491,6 +486,36 @@ describe Appsignal do
|
|
491
486
|
end
|
492
487
|
end
|
493
488
|
|
489
|
+
describe ".add_breadcrumb" do
|
490
|
+
before { allow(Appsignal::Transaction).to receive(:current).and_return(transaction) }
|
491
|
+
|
492
|
+
context "with transaction" do
|
493
|
+
let(:transaction) { double }
|
494
|
+
it "should call add_breadcrumb on transaction" do
|
495
|
+
expect(transaction).to receive(:add_breadcrumb)
|
496
|
+
.with("Network", "http", "User made network request", { :response => 200 }, fixed_time)
|
497
|
+
end
|
498
|
+
|
499
|
+
after do
|
500
|
+
Appsignal.add_breadcrumb(
|
501
|
+
"Network",
|
502
|
+
"http",
|
503
|
+
"User made network request",
|
504
|
+
{ :response => 200 },
|
505
|
+
fixed_time
|
506
|
+
)
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
context "without transaction" do
|
511
|
+
let(:transaction) { nil }
|
512
|
+
|
513
|
+
it "should not call add_breadcrumb on transaction" do
|
514
|
+
expect(Appsignal.add_breadcrumb("Network", "http")).to be_falsy
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|
518
|
+
|
494
519
|
describe "custom stats" do
|
495
520
|
let(:tags) { { :foo => "bar" } }
|
496
521
|
|
@@ -950,70 +975,6 @@ describe Appsignal do
|
|
950
975
|
end
|
951
976
|
end
|
952
977
|
end
|
953
|
-
|
954
|
-
describe ".is_ignored_error?" do
|
955
|
-
let(:error) { StandardError.new }
|
956
|
-
let(:err_stream) { std_stream }
|
957
|
-
let(:stderr) { err_stream.read }
|
958
|
-
before do
|
959
|
-
allow(Appsignal).to receive(:config).and_return(:ignore_errors => ["StandardError"])
|
960
|
-
end
|
961
|
-
|
962
|
-
subject do
|
963
|
-
capture_std_streams(std_stream, err_stream) do
|
964
|
-
Appsignal.is_ignored_error?(error)
|
965
|
-
end
|
966
|
-
end
|
967
|
-
|
968
|
-
it "should return true if it's in the ignored list" do
|
969
|
-
is_expected.to be_truthy
|
970
|
-
end
|
971
|
-
|
972
|
-
it "outputs deprecated warning" do
|
973
|
-
subject
|
974
|
-
expect(stderr).to include("Appsignal.is_ignored_error? is deprecated with no replacement")
|
975
|
-
end
|
976
|
-
|
977
|
-
context "when error is not in the ignored list" do
|
978
|
-
let(:error) { Object.new }
|
979
|
-
|
980
|
-
it "should return false" do
|
981
|
-
is_expected.to be_falsy
|
982
|
-
end
|
983
|
-
end
|
984
|
-
end
|
985
|
-
|
986
|
-
describe ".is_ignored_action?" do
|
987
|
-
let(:action) { "TestController#isup" }
|
988
|
-
let(:err_stream) { std_stream }
|
989
|
-
let(:stderr) { err_stream.read }
|
990
|
-
before do
|
991
|
-
allow(Appsignal).to receive(:config).and_return(:ignore_actions => "TestController#isup")
|
992
|
-
end
|
993
|
-
|
994
|
-
subject do
|
995
|
-
capture_std_streams(std_stream, err_stream) do
|
996
|
-
Appsignal.is_ignored_action?(action)
|
997
|
-
end
|
998
|
-
end
|
999
|
-
|
1000
|
-
it "should return true if it's in the ignored list" do
|
1001
|
-
is_expected.to be_truthy
|
1002
|
-
end
|
1003
|
-
|
1004
|
-
it "outputs deprecated warning" do
|
1005
|
-
subject
|
1006
|
-
expect(stderr).to include("Appsignal.is_ignored_action? is deprecated with no replacement")
|
1007
|
-
end
|
1008
|
-
|
1009
|
-
context "when action is not in the ingore list" do
|
1010
|
-
let(:action) { "TestController#other_action" }
|
1011
|
-
|
1012
|
-
it "should return false" do
|
1013
|
-
is_expected.to be_falsy
|
1014
|
-
end
|
1015
|
-
end
|
1016
|
-
end
|
1017
978
|
end
|
1018
979
|
|
1019
980
|
describe ".start_logger" do
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ ENV["RAILS_ENV"] ||= "test"
|
|
2
2
|
ENV["RACK_ENV"] ||= "test"
|
3
3
|
ENV["PADRINO_ENV"] ||= "test"
|
4
4
|
|
5
|
-
APPSIGNAL_SPEC_DIR = File.expand_path(
|
5
|
+
APPSIGNAL_SPEC_DIR = File.expand_path(__dir__)
|
6
6
|
$LOAD_PATH.unshift(File.join(APPSIGNAL_SPEC_DIR, "support/stubs"))
|
7
7
|
|
8
8
|
Bundler.require :default
|
@@ -85,20 +85,6 @@ RSpec.configure do |config|
|
|
85
85
|
FileUtils.mkdir_p(spec_system_tmp_dir)
|
86
86
|
end
|
87
87
|
|
88
|
-
config.before :each, :only_ruby19 => true do
|
89
|
-
is_ruby19 = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0.0")
|
90
|
-
next if is_ruby19
|
91
|
-
|
92
|
-
skip "Skipping spec. Only for Ruby 1.9"
|
93
|
-
end
|
94
|
-
|
95
|
-
config.before :each, :not_ruby19 => true do
|
96
|
-
is_ruby19 = Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.0.0")
|
97
|
-
next unless is_ruby19
|
98
|
-
|
99
|
-
skip "Skipping spec for Ruby 1.9"
|
100
|
-
end
|
101
|
-
|
102
88
|
config.before do
|
103
89
|
stop_minutely_probes
|
104
90
|
ENV["RAILS_ENV"] ||= "test"
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appsignal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0.beta.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Robert Beekman
|
8
8
|
- Thijs Cadier
|
9
9
|
- Tom de Bruijn
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -202,7 +202,6 @@ files:
|
|
202
202
|
- lib/appsignal/cli/diagnose/utils.rb
|
203
203
|
- lib/appsignal/cli/helpers.rb
|
204
204
|
- lib/appsignal/cli/install.rb
|
205
|
-
- lib/appsignal/cli/notify_of_deploy.rb
|
206
205
|
- lib/appsignal/config.rb
|
207
206
|
- lib/appsignal/demo.rb
|
208
207
|
- lib/appsignal/environment.rb
|
@@ -240,22 +239,25 @@ files:
|
|
240
239
|
- lib/appsignal/hooks/sidekiq.rb
|
241
240
|
- lib/appsignal/hooks/unicorn.rb
|
242
241
|
- lib/appsignal/hooks/webmachine.rb
|
242
|
+
- lib/appsignal/integrations/action_cable.rb
|
243
|
+
- lib/appsignal/integrations/active_support_notifications.rb
|
243
244
|
- lib/appsignal/integrations/capistrano/appsignal.cap
|
244
245
|
- lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
|
245
246
|
- lib/appsignal/integrations/data_mapper.rb
|
246
247
|
- lib/appsignal/integrations/delayed_job_plugin.rb
|
247
248
|
- lib/appsignal/integrations/grape.rb
|
248
249
|
- lib/appsignal/integrations/mongo_ruby_driver.rb
|
250
|
+
- lib/appsignal/integrations/net_http.rb
|
249
251
|
- lib/appsignal/integrations/object.rb
|
250
252
|
- lib/appsignal/integrations/padrino.rb
|
251
253
|
- lib/appsignal/integrations/que.rb
|
252
254
|
- lib/appsignal/integrations/railtie.rb
|
253
255
|
- lib/appsignal/integrations/rake.rb
|
256
|
+
- lib/appsignal/integrations/redis.rb
|
254
257
|
- lib/appsignal/integrations/resque.rb
|
255
|
-
- lib/appsignal/integrations/resque_active_job.rb
|
256
258
|
- lib/appsignal/integrations/sinatra.rb
|
259
|
+
- lib/appsignal/integrations/unicorn.rb
|
257
260
|
- lib/appsignal/integrations/webmachine.rb
|
258
|
-
- lib/appsignal/js_exception_transaction.rb
|
259
261
|
- lib/appsignal/logger.rb
|
260
262
|
- lib/appsignal/marker.rb
|
261
263
|
- lib/appsignal/minutely.rb
|
@@ -263,7 +265,6 @@ files:
|
|
263
265
|
- lib/appsignal/probes/puma.rb
|
264
266
|
- lib/appsignal/probes/sidekiq.rb
|
265
267
|
- lib/appsignal/rack/generic_instrumentation.rb
|
266
|
-
- lib/appsignal/rack/js_exception_catcher.rb
|
267
268
|
- lib/appsignal/rack/rails_instrumentation.rb
|
268
269
|
- lib/appsignal/rack/sinatra_instrumentation.rb
|
269
270
|
- lib/appsignal/rack/streaming_listener.rb
|
@@ -292,7 +293,6 @@ files:
|
|
292
293
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
293
294
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
294
295
|
- spec/lib/appsignal/cli/install_spec.rb
|
295
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
296
296
|
- spec/lib/appsignal/cli_spec.rb
|
297
297
|
- spec/lib/appsignal/config_spec.rb
|
298
298
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -340,18 +340,14 @@ files:
|
|
340
340
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
341
341
|
- spec/lib/appsignal/integrations/que_spec.rb
|
342
342
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
343
|
-
- spec/lib/appsignal/integrations/resque_active_job_spec.rb
|
344
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
345
343
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
346
344
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
347
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
348
345
|
- spec/lib/appsignal/logger_spec.rb
|
349
346
|
- spec/lib/appsignal/marker_spec.rb
|
350
347
|
- spec/lib/appsignal/minutely_spec.rb
|
351
348
|
- spec/lib/appsignal/probes/puma_spec.rb
|
352
349
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
353
350
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
354
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
355
351
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
356
352
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
357
353
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
@@ -413,7 +409,7 @@ metadata:
|
|
413
409
|
documentation_uri: https://docs.appsignal.com/ruby/
|
414
410
|
homepage_uri: https://docs.appsignal.com/ruby/
|
415
411
|
source_code_uri: https://github.com/appsignal/appsignal-ruby
|
416
|
-
post_install_message:
|
412
|
+
post_install_message:
|
417
413
|
rdoc_options: []
|
418
414
|
require_paths:
|
419
415
|
- lib
|
@@ -425,12 +421,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
425
421
|
version: '1.9'
|
426
422
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
427
423
|
requirements:
|
428
|
-
- - "
|
424
|
+
- - ">"
|
429
425
|
- !ruby/object:Gem::Version
|
430
|
-
version:
|
426
|
+
version: 1.3.1
|
431
427
|
requirements: []
|
432
|
-
rubygems_version: 3.
|
433
|
-
signing_key:
|
428
|
+
rubygems_version: 3.2.6
|
429
|
+
signing_key:
|
434
430
|
specification_version: 4
|
435
431
|
summary: Logs performance and exception data from your app to appsignal.com
|
436
432
|
test_files:
|
@@ -444,7 +440,6 @@ test_files:
|
|
444
440
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
445
441
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
446
442
|
- spec/lib/appsignal/cli/install_spec.rb
|
447
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
448
443
|
- spec/lib/appsignal/cli_spec.rb
|
449
444
|
- spec/lib/appsignal/config_spec.rb
|
450
445
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -492,18 +487,14 @@ test_files:
|
|
492
487
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
493
488
|
- spec/lib/appsignal/integrations/que_spec.rb
|
494
489
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
495
|
-
- spec/lib/appsignal/integrations/resque_active_job_spec.rb
|
496
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
497
490
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
498
491
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
499
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
500
492
|
- spec/lib/appsignal/logger_spec.rb
|
501
493
|
- spec/lib/appsignal/marker_spec.rb
|
502
494
|
- spec/lib/appsignal/minutely_spec.rb
|
503
495
|
- spec/lib/appsignal/probes/puma_spec.rb
|
504
496
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
505
497
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
506
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
507
498
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
508
499
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
509
500
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
@@ -1,131 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Appsignal
|
4
|
-
class CLI
|
5
|
-
# Command line tool to send a "Deploy Marker" for an application to
|
6
|
-
# AppSignal.
|
7
|
-
#
|
8
|
-
# Deploy markers are used on AppSignal.com to indicate changes in an
|
9
|
-
# application, "Deploy markers" indicate a deploy of an application.
|
10
|
-
#
|
11
|
-
# Incidents for exceptions and performance issues will be closed and
|
12
|
-
# reopened if they occur again in the new deploy.
|
13
|
-
#
|
14
|
-
# @note The same logic is used in the Capistrano integration. A deploy
|
15
|
-
# marker is created on each deploy.
|
16
|
-
#
|
17
|
-
# ## Options
|
18
|
-
#
|
19
|
-
# - `--environment` required. The environment of the application being
|
20
|
-
# deployed.
|
21
|
-
# - `--user` required. User that triggered the deploy.
|
22
|
-
# - `--revision` required. Git commit SHA or other identifiable revision id.
|
23
|
-
# - `--name` If no "name" config can be found in a `config/appsignal.yml`
|
24
|
-
# file or based on the `APPSIGNAL_APP_NAME` environment variable, this
|
25
|
-
# option is required.
|
26
|
-
#
|
27
|
-
# ## Exit codes
|
28
|
-
#
|
29
|
-
# - Exits with status code `0` if the deploy marker is sent.
|
30
|
-
# - Exits with status code `1` if the configuration is not valid and active.
|
31
|
-
# - Exits with status code `1` if the required options aren't present.
|
32
|
-
#
|
33
|
-
# @example basic example
|
34
|
-
# appsignal notify_of_deploy \
|
35
|
-
# --user=tom \
|
36
|
-
# --environment=production \
|
37
|
-
# --revision=abc1234
|
38
|
-
#
|
39
|
-
# @example using a custom app name
|
40
|
-
# appsignal notify_of_deploy \
|
41
|
-
# --user=tom \
|
42
|
-
# --environment=production \
|
43
|
-
# --revision=abc1234 \
|
44
|
-
# --name="My app"
|
45
|
-
#
|
46
|
-
# @example help command
|
47
|
-
# appsignal notify_of_deploy --help
|
48
|
-
#
|
49
|
-
# @deprecated This method of sending AppSignal deploy markers is
|
50
|
-
# deprecated. Use the [`revision` config option]
|
51
|
-
# (https://docs.appsignal.com/ruby/configuration/options.html#app_revision-revision)
|
52
|
-
# instead. For more information, please read the [deploy markers]
|
53
|
-
# (https://docs.appsignal.com/application/markers/deploy-markers.html)
|
54
|
-
# documentation.
|
55
|
-
# @since 0.2.5
|
56
|
-
# @see Appsignal::Marker Appsignal::Marker
|
57
|
-
# @see http://docs.appsignal.com/ruby/command-line/notify_of_deploy.html
|
58
|
-
# AppSignal notify_of_deploy documentation
|
59
|
-
# @see http://docs.appsignal.com/appsignal/terminology.html#markers
|
60
|
-
# Terminology: Deploy marker
|
61
|
-
class NotifyOfDeploy
|
62
|
-
class << self
|
63
|
-
include Appsignal::Utils::DeprecationMessage
|
64
|
-
|
65
|
-
# @param options [Hash]
|
66
|
-
# @option options :environment [String] environment to load
|
67
|
-
# configuration for.
|
68
|
-
# @option options :name [String] custom name of the application.
|
69
|
-
# @option options :user [String] user who triggered the deploy.
|
70
|
-
# @option options :revision [String] the revision that has been
|
71
|
-
# deployed. E.g. a git commit SHA.
|
72
|
-
# @return [void]
|
73
|
-
def run(options)
|
74
|
-
config = config_for(options[:environment])
|
75
|
-
config[:name] = options[:name] if options[:name]
|
76
|
-
|
77
|
-
validate_active_config(config)
|
78
|
-
required_config = [:revision, :user]
|
79
|
-
required_config << :environment if config.env.empty?
|
80
|
-
required_config << :name if !config[:name] || config[:name].empty?
|
81
|
-
validate_required_options(options, required_config)
|
82
|
-
|
83
|
-
Appsignal::Marker.new(
|
84
|
-
{
|
85
|
-
:revision => options[:revision],
|
86
|
-
:user => options[:user]
|
87
|
-
},
|
88
|
-
config
|
89
|
-
).transmit
|
90
|
-
|
91
|
-
puts
|
92
|
-
message = "This command (appsignal notify_of_deploy) has been " \
|
93
|
-
"deprecated in favor of the `revision` config option. Please " \
|
94
|
-
"see our documentation for more information on the recommended " \
|
95
|
-
"method: " \
|
96
|
-
"https://docs.appsignal.com/application/markers/deploy-markers.html"
|
97
|
-
deprecation_message message
|
98
|
-
end
|
99
|
-
|
100
|
-
private
|
101
|
-
|
102
|
-
def validate_required_options(options, required_options)
|
103
|
-
missing = required_options.select do |required_option|
|
104
|
-
val = options[required_option]
|
105
|
-
val.nil? || (val.respond_to?(:empty?) && val.empty?)
|
106
|
-
end
|
107
|
-
return unless missing.any?
|
108
|
-
|
109
|
-
puts "Error: Missing options: #{missing.join(", ")}"
|
110
|
-
exit 1
|
111
|
-
end
|
112
|
-
|
113
|
-
def validate_active_config(config)
|
114
|
-
return if config.active?
|
115
|
-
|
116
|
-
puts "Error: No valid config found."
|
117
|
-
exit 1
|
118
|
-
end
|
119
|
-
|
120
|
-
def config_for(environment)
|
121
|
-
Appsignal::Config.new(
|
122
|
-
Dir.pwd,
|
123
|
-
environment,
|
124
|
-
{},
|
125
|
-
Logger.new(StringIO.new)
|
126
|
-
)
|
127
|
-
end
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Appsignal
|
4
|
-
module Integrations
|
5
|
-
# @api private
|
6
|
-
module ResqueActiveJobPlugin
|
7
|
-
def self.included(_)
|
8
|
-
callers = caller
|
9
|
-
Appsignal::Utils::DeprecationMessage.message \
|
10
|
-
"The AppSignal ResqueActiveJobPlugin is deprecated and does " \
|
11
|
-
"nothing on extend. In this version of the AppSignal Ruby gem " \
|
12
|
-
"the integration with Resque is automatic on all Resque workers. " \
|
13
|
-
"Please remove the following line from this file to remove this " \
|
14
|
-
"message: include Appsignal::Integrations::ResqueActiveJobPlugin\n" \
|
15
|
-
"#{callers.first}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|