appsignal 2.10.10-java → 2.10.11-java

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: 5aa436344bd8f09b91f6e8124ed79d698abad386484b838b8823b741067cb2e8
4
- data.tar.gz: a493a3040d2d77d2c972304da7286cebad85a782c007826042bd81008142ef1a
3
+ metadata.gz: d565cfd8db2282ca0a5cebc1bda0485d5fff26381fa4ebf0d6e39bf4bf6d060d
4
+ data.tar.gz: befbc7775e674cd682e8090c5f638fddeddef0eb6b2bac6ca35acc212cadea94
5
5
  SHA512:
6
- metadata.gz: 7bd23ee2f2f605b6fa74dfef6e3ec4c12fa63e9c39715600015c08e7188bac50db078a766e81b40f064780cac4da09f413cd656169c049dc9407ed54785e2990
7
- data.tar.gz: 5598b795b51165165745abd480a2c191e62d52bf5bb73b1d6a141d1cd1dffddd21edb23965916112e3a1f131c77ace333bdb3abd4be09e0f03f266a67c05da0b
6
+ metadata.gz: a42301c4ff83f2ed0ae6808ef2ef53f5439c9635b708f2297ad5dbaef9407269c9e8e79c3e014b1ca51e5752315a20a80da8a930a3b57dd43a22984bde069690
7
+ data.tar.gz: 36aa97a5d728eaeb4269a94766f3ca7a2917bb6ef90dd55ad7704ce6b753c702036613c910db07c8d43f0c9463067ab5672886f4b3e50526ecc078efba526743
@@ -11,7 +11,7 @@ agent:
11
11
  os_image: ubuntu1804
12
12
  auto_cancel:
13
13
  running:
14
- when: branch != 'master' AND branch != 'develop'
14
+ when: branch != 'main' AND branch != 'develop'
15
15
  global_job_config:
16
16
  env_vars:
17
17
  - name: _BUNDLER_CACHE
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ # 2.10.11
4
+ - Fix extension install report status output in `appsignal diagnose`. PR #636
5
+ - Support setting a specific configuration file to load with the
6
+ `Appsignal::Config` initializer. PR #638
7
+
3
8
  # 2.10.10
4
9
  - Bump agent to v-4548c88. PR #634
5
10
  - Fix issue with host metrics values being reported as "Infinity".
data/README.md CHANGED
@@ -9,7 +9,7 @@ issues.
9
9
  - [Ruby code documentation][ruby-doc]
10
10
  - [Support][contact]
11
11
 
12
- [![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/master.svg)](https://appsignal.semaphoreci.com/projects/appsignal-ruby)
12
+ [![Build status](https://appsignal.semaphoreci.com/badges/appsignal-ruby/branches/main.svg)](https://appsignal.semaphoreci.com/projects/appsignal-ruby)
13
13
  [![Gem Version](https://badge.fury.io/rb/appsignal.svg)](http://badge.fury.io/rb/appsignal)
14
14
  [![Code Climate](https://codeclimate.com/github/appsignal/appsignal.png)](https://codeclimate.com/github/appsignal/appsignal)
15
15
 
@@ -183,7 +183,7 @@ installing the AppSignal C-extension.
183
183
  # Gemfile
184
184
  gem "appsignal",
185
185
  :git => "https://github.com/appsignal/appsignal-ruby.git",
186
- :branch => "master"
186
+ :branch => "main"
187
187
  ```
188
188
 
189
189
  When you need to use a git source of the gem in your JRuby install, you'll need
@@ -242,12 +242,12 @@ a number of different Ruby versions.
242
242
 
243
243
  This gem uses [Semantic Versioning][semver].
244
244
 
245
- The `master` branch corresponds to the current stable release of the gem.
245
+ The `main` branch corresponds to the current stable release of the gem.
246
246
 
247
247
  The `develop` branch is used for development of features that will end up in
248
248
  the next minor release.
249
249
 
250
- Open a Pull Request on the `master` branch if you're fixing a bug. For new new
250
+ Open a Pull Request on the `main` branch if you're fixing a bug. For new new
251
251
  features, open a Pull Request on the `develop` branch.
252
252
 
253
253
  Every stable and unstable release is tagged in git with a version tag.
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem| # rubocop:disable Metrics/BlockLength
29
29
  gem.metadata = {
30
30
  "bug_tracker_uri" => "https://github.com/appsignal/appsignal-ruby/issues",
31
31
  "changelog_uri" =>
32
- "https://github.com/appsignal/appsignal-ruby/blob/master/CHANGELOG.md",
32
+ "https://github.com/appsignal/appsignal-ruby/blob/main/CHANGELOG.md",
33
33
  "documentation_uri" => "https://docs.appsignal.com/ruby/",
34
34
  "homepage_uri" => "https://docs.appsignal.com/ruby/",
35
35
  "source_code_uri" => "https://github.com/appsignal/appsignal-ruby"
@@ -10,8 +10,8 @@ semaphore: # Default `.semaphore/semaphore.yml` contents
10
10
  # Cancel all running and queued workflows before this one
11
11
  auto_cancel:
12
12
  running:
13
- # Ignore master AND develop branch as we want it to build all workflows
14
- when: "branch != 'master' AND branch != 'develop'"
13
+ # Ignore main AND develop branch as we want it to build all workflows
14
+ when: "branch != 'main' AND branch != 'develop'"
15
15
 
16
16
  global_job_config:
17
17
  env_vars:
@@ -371,7 +371,7 @@ module Appsignal
371
371
  end
372
372
 
373
373
  def print_installation_result_report(report)
374
- report = report.fetch("download", {})
374
+ report = report.fetch("result", {})
375
375
  puts " Installation result"
376
376
  puts " Status: #{report["status"]}"
377
377
  puts " Message: #{report["message"]}" if report["message"]
@@ -119,8 +119,41 @@ module Appsignal
119
119
  :initial_config, :file_config, :env_config
120
120
  attr_accessor :logger
121
121
 
122
- def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger)
122
+ # Initialize a new configuration object for AppSignal.
123
+ #
124
+ # If this is manually initialized, and not by {Appsignal.start}, it needs
125
+ # to be assigned to the {Appsignal.config} attribute.
126
+ #
127
+ # @example
128
+ # require "appsignal"
129
+ # Appsignal.config = Appsignal::Config.new(
130
+ # app_path,
131
+ # "production"
132
+ # )
133
+ # Appsignal.start
134
+ #
135
+ # @param root_path [String] Root path of the app.
136
+ # @param env [String] The environment to load when AppSignal is started. It
137
+ # will look for an environment with this name in the `config/appsignal.yml`
138
+ # config file.
139
+ # @param initial_config [Hash<String, Object>] The initial configuration to
140
+ # use. This will be overwritten by the file config and environment
141
+ # variables config.
142
+ # @param logger [Logger] The logger to use for the AppSignal gem. This is
143
+ # used by the configuration class only. Default: {Appsignal.logger}. See
144
+ # also {Appsignal.start_logger}.
145
+ # @param config_file [String] Custom config file location. Default
146
+ # `config/appsignal.yml`.
147
+ #
148
+ # @see https://docs.appsignal.com/ruby/configuration/
149
+ # Configuration documentation
150
+ # @see https://docs.appsignal.com/ruby/configuration/load-order.html
151
+ # Configuration load order
152
+ # @see https://docs.appsignal.com/ruby/instrumentation/integrating-appsignal.html
153
+ # How to integrate AppSignal manually
154
+ def initialize(root_path, env, initial_config = {}, logger = Appsignal.logger, config_file = nil)
123
155
  @root_path = root_path
156
+ @config_file = config_file
124
157
  @logger = logger
125
158
  @valid = false
126
159
  @config_hash = Hash[DEFAULT_CONFIG]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "2.10.10".freeze
4
+ VERSION = "2.10.11".freeze
5
5
  end
@@ -10,7 +10,7 @@ if DependencyHelper.capistrano2_present?
10
10
  let(:capistrano_config) do
11
11
  Capistrano::Configuration.new.tap do |c|
12
12
  c.set(:rails_env, "production")
13
- c.set(:repository, "master")
13
+ c.set(:repository, "main")
14
14
  c.set(:deploy_to, "/home/username/app")
15
15
  c.set(:current_release, "")
16
16
  c.set(:current_revision, "503ce0923ed177a3ce000005")
@@ -15,7 +15,7 @@ if DependencyHelper.capistrano3_present?
15
15
  c.set(:log_level, :error)
16
16
  c.set(:logger, logger)
17
17
  c.set(:rails_env, "production")
18
- c.set(:repository, "master")
18
+ c.set(:repository, "main")
19
19
  c.set(:deploy_to, "/home/username/app")
20
20
  c.set(:current_release, "")
21
21
  c.set(:current_revision, "503ce0923ed177a3ce000005")
@@ -290,6 +290,8 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
290
290
  jruby = Appsignal::System.jruby?
291
291
  expect(output).to include(
292
292
  "Extension installation report",
293
+ "Installation result",
294
+ " Status: success",
293
295
  "Language details",
294
296
  " Implementation: #{jruby ? "jruby" : "ruby"}",
295
297
  " Ruby version: #{"#{rbconfig["ruby_version"]}-p#{rbconfig["PATCHLEVEL"]}"}",
@@ -310,6 +312,46 @@ describe Appsignal::CLI::Diagnose, :api_stub => true, :send_report => :yes_cli_i
310
312
  )
311
313
  end
312
314
 
315
+ context "with error in install report" do
316
+ let(:error) { RuntimeError.new("some error") }
317
+ before do
318
+ allow(File).to receive(:read).and_call_original
319
+ expect(File).to receive(:read)
320
+ .with(File.expand_path("../../../../../ext/install.report", __FILE__))
321
+ .and_return(
322
+ YAML.dump(
323
+ "result" => {
324
+ "status" => "error",
325
+ "error" => "RuntimeError: some error",
326
+ "backtrace" => error.backtrace
327
+ }
328
+ )
329
+ )
330
+ end
331
+
332
+ it "sends an error" do
333
+ run
334
+ expect(received_report["installation"]).to match(
335
+ "result" => {
336
+ "status" => "error",
337
+ "error" => "RuntimeError: some error",
338
+ "backtrace" => error.backtrace
339
+ }
340
+ )
341
+ end
342
+
343
+ it "prints the error" do
344
+ run
345
+
346
+ expect(output).to include(
347
+ "Extension installation report",
348
+ "Installation result",
349
+ "Status: error\n Error: RuntimeError: some error"
350
+ )
351
+ expect(output).to_not include("Raw report:")
352
+ end
353
+ end
354
+
313
355
  context "without install report" do
314
356
  let(:error) { RuntimeError.new("foo") }
315
357
  before do
@@ -243,6 +243,27 @@ describe Appsignal::Config do
243
243
  end
244
244
  end
245
245
 
246
+ context "with an overriden config file" do
247
+ let(:config) do
248
+ project_fixture_config("production", {}, Appsignal.logger, File.join(project_fixture_path, "config", "appsignal.yml"))
249
+ end
250
+
251
+ it "is valid and active" do
252
+ expect(config.valid?).to be_truthy
253
+ expect(config.active?).to be_truthy
254
+ end
255
+
256
+ context "with an invalid overriden config file" do
257
+ let(:config) do
258
+ project_fixture_config("production", {}, Appsignal.logger, File.join(project_fixture_path, "config", "missing.yml"))
259
+ end
260
+
261
+ it "is not valid" do
262
+ expect(config.valid?).to be_falsy
263
+ end
264
+ end
265
+ end
266
+
246
267
  context "with the config file causing an error" do
247
268
  let(:config_path) do
248
269
  File.expand_path(
@@ -4,7 +4,7 @@ describe Appsignal::Marker do
4
4
  described_class.new(
5
5
  {
6
6
  :revision => "503ce0923ed177a3ce000005",
7
- :repository => "master",
7
+ :repository => "main",
8
8
  :user => "batman",
9
9
  :rails_env => "production"
10
10
  },
@@ -5,12 +5,13 @@ module ConfigHelpers
5
5
  )
6
6
  end
7
7
 
8
- def project_fixture_config(env = "production", initial_config = {}, logger = Appsignal.logger)
8
+ def project_fixture_config(env = "production", initial_config = {}, logger = Appsignal.logger, config_file = nil)
9
9
  Appsignal::Config.new(
10
10
  project_fixture_path,
11
11
  env,
12
12
  initial_config,
13
- logger
13
+ logger,
14
+ config_file
14
15
  )
15
16
  end
16
17
 
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: 2.10.10
4
+ version: 2.10.11
5
5
  platform: java
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: 2020-07-08 00:00:00.000000000 Z
13
+ date: 2020-07-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -389,7 +389,7 @@ licenses:
389
389
  - MIT
390
390
  metadata:
391
391
  bug_tracker_uri: https://github.com/appsignal/appsignal-ruby/issues
392
- changelog_uri: https://github.com/appsignal/appsignal-ruby/blob/master/CHANGELOG.md
392
+ changelog_uri: https://github.com/appsignal/appsignal-ruby/blob/main/CHANGELOG.md
393
393
  documentation_uri: https://docs.appsignal.com/ruby/
394
394
  homepage_uri: https://docs.appsignal.com/ruby/
395
395
  source_code_uri: https://github.com/appsignal/appsignal-ruby