appsignal 2.11.1 → 3.0.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- 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: ruby
|
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
|
@@ -188,7 +188,6 @@ files:
|
|
188
188
|
- lib/appsignal/cli/diagnose/utils.rb
|
189
189
|
- lib/appsignal/cli/helpers.rb
|
190
190
|
- lib/appsignal/cli/install.rb
|
191
|
-
- lib/appsignal/cli/notify_of_deploy.rb
|
192
191
|
- lib/appsignal/config.rb
|
193
192
|
- lib/appsignal/demo.rb
|
194
193
|
- lib/appsignal/environment.rb
|
@@ -226,22 +225,25 @@ files:
|
|
226
225
|
- lib/appsignal/hooks/sidekiq.rb
|
227
226
|
- lib/appsignal/hooks/unicorn.rb
|
228
227
|
- lib/appsignal/hooks/webmachine.rb
|
228
|
+
- lib/appsignal/integrations/action_cable.rb
|
229
|
+
- lib/appsignal/integrations/active_support_notifications.rb
|
229
230
|
- lib/appsignal/integrations/capistrano/appsignal.cap
|
230
231
|
- lib/appsignal/integrations/capistrano/capistrano_2_tasks.rb
|
231
232
|
- lib/appsignal/integrations/data_mapper.rb
|
232
233
|
- lib/appsignal/integrations/delayed_job_plugin.rb
|
233
234
|
- lib/appsignal/integrations/grape.rb
|
234
235
|
- lib/appsignal/integrations/mongo_ruby_driver.rb
|
236
|
+
- lib/appsignal/integrations/net_http.rb
|
235
237
|
- lib/appsignal/integrations/object.rb
|
236
238
|
- lib/appsignal/integrations/padrino.rb
|
237
239
|
- lib/appsignal/integrations/que.rb
|
238
240
|
- lib/appsignal/integrations/railtie.rb
|
239
241
|
- lib/appsignal/integrations/rake.rb
|
242
|
+
- lib/appsignal/integrations/redis.rb
|
240
243
|
- lib/appsignal/integrations/resque.rb
|
241
|
-
- lib/appsignal/integrations/resque_active_job.rb
|
242
244
|
- lib/appsignal/integrations/sinatra.rb
|
245
|
+
- lib/appsignal/integrations/unicorn.rb
|
243
246
|
- lib/appsignal/integrations/webmachine.rb
|
244
|
-
- lib/appsignal/js_exception_transaction.rb
|
245
247
|
- lib/appsignal/logger.rb
|
246
248
|
- lib/appsignal/marker.rb
|
247
249
|
- lib/appsignal/minutely.rb
|
@@ -249,7 +251,6 @@ files:
|
|
249
251
|
- lib/appsignal/probes/puma.rb
|
250
252
|
- lib/appsignal/probes/sidekiq.rb
|
251
253
|
- lib/appsignal/rack/generic_instrumentation.rb
|
252
|
-
- lib/appsignal/rack/js_exception_catcher.rb
|
253
254
|
- lib/appsignal/rack/rails_instrumentation.rb
|
254
255
|
- lib/appsignal/rack/sinatra_instrumentation.rb
|
255
256
|
- lib/appsignal/rack/streaming_listener.rb
|
@@ -278,7 +279,6 @@ files:
|
|
278
279
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
279
280
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
280
281
|
- spec/lib/appsignal/cli/install_spec.rb
|
281
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
282
282
|
- spec/lib/appsignal/cli_spec.rb
|
283
283
|
- spec/lib/appsignal/config_spec.rb
|
284
284
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -326,18 +326,14 @@ files:
|
|
326
326
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
327
327
|
- spec/lib/appsignal/integrations/que_spec.rb
|
328
328
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
329
|
-
- spec/lib/appsignal/integrations/resque_active_job_spec.rb
|
330
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
331
329
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
332
330
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
333
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
334
331
|
- spec/lib/appsignal/logger_spec.rb
|
335
332
|
- spec/lib/appsignal/marker_spec.rb
|
336
333
|
- spec/lib/appsignal/minutely_spec.rb
|
337
334
|
- spec/lib/appsignal/probes/puma_spec.rb
|
338
335
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
339
336
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
340
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
341
337
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
342
338
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
343
339
|
- spec/lib/appsignal/rack/streaming_listener_spec.rb
|
@@ -399,7 +395,7 @@ metadata:
|
|
399
395
|
documentation_uri: https://docs.appsignal.com/ruby/
|
400
396
|
homepage_uri: https://docs.appsignal.com/ruby/
|
401
397
|
source_code_uri: https://github.com/appsignal/appsignal-ruby
|
402
|
-
post_install_message:
|
398
|
+
post_install_message:
|
403
399
|
rdoc_options: []
|
404
400
|
require_paths:
|
405
401
|
- lib
|
@@ -411,12 +407,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
411
407
|
version: '1.9'
|
412
408
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
413
409
|
requirements:
|
414
|
-
- - "
|
410
|
+
- - ">"
|
415
411
|
- !ruby/object:Gem::Version
|
416
|
-
version:
|
412
|
+
version: 1.3.1
|
417
413
|
requirements: []
|
418
|
-
rubygems_version: 3.
|
419
|
-
signing_key:
|
414
|
+
rubygems_version: 3.2.6
|
415
|
+
signing_key:
|
420
416
|
specification_version: 4
|
421
417
|
summary: Logs performance and exception data from your app to appsignal.com
|
422
418
|
test_files:
|
@@ -430,7 +426,6 @@ test_files:
|
|
430
426
|
- spec/lib/appsignal/cli/diagnose_spec.rb
|
431
427
|
- spec/lib/appsignal/cli/helpers_spec.rb
|
432
428
|
- spec/lib/appsignal/cli/install_spec.rb
|
433
|
-
- spec/lib/appsignal/cli/notify_of_deploy_spec.rb
|
434
429
|
- spec/lib/appsignal/cli_spec.rb
|
435
430
|
- spec/lib/appsignal/config_spec.rb
|
436
431
|
- spec/lib/appsignal/demo_spec.rb
|
@@ -478,18 +473,14 @@ test_files:
|
|
478
473
|
- spec/lib/appsignal/integrations/padrino_spec.rb
|
479
474
|
- spec/lib/appsignal/integrations/que_spec.rb
|
480
475
|
- spec/lib/appsignal/integrations/railtie_spec.rb
|
481
|
-
- spec/lib/appsignal/integrations/resque_active_job_spec.rb
|
482
|
-
- spec/lib/appsignal/integrations/resque_spec.rb
|
483
476
|
- spec/lib/appsignal/integrations/sinatra_spec.rb
|
484
477
|
- spec/lib/appsignal/integrations/webmachine_spec.rb
|
485
|
-
- spec/lib/appsignal/js_exception_transaction_spec.rb
|
486
478
|
- spec/lib/appsignal/logger_spec.rb
|
487
479
|
- spec/lib/appsignal/marker_spec.rb
|
488
480
|
- spec/lib/appsignal/minutely_spec.rb
|
489
481
|
- spec/lib/appsignal/probes/puma_spec.rb
|
490
482
|
- spec/lib/appsignal/probes/sidekiq_spec.rb
|
491
483
|
- spec/lib/appsignal/rack/generic_instrumentation_spec.rb
|
492
|
-
- spec/lib/appsignal/rack/js_exception_catcher_spec.rb
|
493
484
|
- spec/lib/appsignal/rack/rails_instrumentation_spec.rb
|
494
485
|
- spec/lib/appsignal/rack/sinatra_instrumentation_spec.rb
|
495
486
|
- 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
|