honeybadger 4.7.2 → 4.8.0

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: ae86ea681a8b1e58775976adc5fe1300cfa043865c9a72344b5ae2dfcde2565a
4
- data.tar.gz: 98a92af83ec77fff0fba12fd551ca81417ed04d0cfdba225a262f1db2786ad82
3
+ metadata.gz: b3ec66f5016be98ed5d5a4d805a7dca2069a1c585ac10809813acd999a4f96eb
4
+ data.tar.gz: d7a4179a6bfad487e789749ca3e38d90bc84cc4bfa1b4fbc2ce48b48a233023c
5
5
  SHA512:
6
- metadata.gz: bad75cfca393708ec07292b6e34257afdaad23753e7fe26b96e8c9d1ca5d46099f9da13b93b53d49d5a77569913e0048a883cc6bf73b04686d85060805e8d681
7
- data.tar.gz: 79e8f88c82d3e8da1eb968b4f9df0ba88da145a034cd6c82cd7e3bf84649d9d5d3c7e3586ce12e391b3f097c9a955231654a825726ac9a697050ffdbca2df64d
6
+ metadata.gz: c5b6a551d2d3fe7feca0d4c9c02878e476a5478532475a50b46f84801ede717ea7909903c8b267f33cf62fd1dac22d8258905e86fc764f372ce63bd7bdfcd400
7
+ data.tar.gz: d143a769fe1407606480ca83415e63c937bf7d26d3ce1cbf436eefad84542c9079b6eb8659bbb31d10fadc9baa03a38e96601e7d5e08f8e8cea9a1a0fee26ebc
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.8.0] - 2021-03-16
9
+ ### Fixed
10
+ - Suppress any error output from the `git rev-parse` command. ([#394](https://github.com/honeybadger-io/honeybadger-ruby/pull/394))
11
+
12
+ ### Added
13
+ - Support deployment tracking in code (#397, @danleyden)
14
+
15
+ ## [4.7.3] - 2021-02-10
16
+ ### Fixed
17
+ - Don't enable Lambda plugin in non-Lambda execution environments
18
+
8
19
  ## [4.7.2] - 2020-08-17
9
20
  ### Fixed
10
21
  - Remove usage of `ActiveRecord::Base.connection` (thanks @jcoyne for testing)
@@ -190,6 +190,29 @@ module Honeybadger
190
190
  response.success?
191
191
  end
192
192
 
193
+ # Track a new deployment
194
+ #
195
+ # @example
196
+ # Honeybadger.track_deployment(revision: 'be2ceb6')
197
+ #
198
+ # @param [String] :env The environment name. Defaults to the current configured environment.
199
+ # @param [String] :revision The VCS revision being deployed. Defaults to the currently configured revision.
200
+ # @param [String] :local_username The name of the user who performed the deploy.
201
+ # @param [String] :repository The base URL of the VCS repository. It should be HTTPS-style.
202
+ #
203
+ # @return [Boolean] true if the deployment was successfully tracked and false
204
+ # otherwise.
205
+ def track_deployment(env: nil, revision: nil, local_username: nil, repository: nil)
206
+ opts = {
207
+ env: env || config[:env],
208
+ revision: revision || config[:revision],
209
+ local_username: local_username,
210
+ repository: repository
211
+ }
212
+ response = backend.track_deployment(opts)
213
+ response.success?
214
+ end
215
+
193
216
  # Save global context for the current request.
194
217
  #
195
218
  # @example
@@ -99,6 +99,15 @@ module Honeybadger
99
99
  raise NotImplementedError, 'must define #check_in on subclass.'
100
100
  end
101
101
 
102
+ # Track a deployment
103
+ # @example
104
+ # backend.track_deployment({ revision: 'be2ceb6' })
105
+ #
106
+ # @param [#to_json] payload The JSON payload containing all deployment data.
107
+ def track_deployment(payload)
108
+ notify(:deploys, payload)
109
+ end
110
+
102
111
  private
103
112
 
104
113
  attr_reader :config
@@ -37,6 +37,7 @@ module Honeybadger
37
37
  def_delegator :'Honeybadger::Agent.instance', :add_breadcrumb
38
38
  def_delegator :'Honeybadger::Agent.instance', :breadcrumbs
39
39
  def_delegator :'Honeybadger::Agent.instance', :clear!
40
+ def_delegator :'Honeybadger::Agent.instance', :track_deployment
40
41
 
41
42
  # @!macro [attach] def_delegator
42
43
  # @!method $2(...)
@@ -14,7 +14,7 @@ module Honeybadger
14
14
 
15
15
  class << self
16
16
  def lambda_execution?
17
- !!ENV["AWS_EXECUTION_ENV"]
17
+ !!ENV["AWS_LAMBDA_FUNCTION_NAME"]
18
18
  end
19
19
 
20
20
  def normalized_data
@@ -26,7 +26,7 @@ module Honeybadger
26
26
 
27
27
  def from_git
28
28
  return nil unless File.directory?('.git')
29
- `git rev-parse HEAD`.strip rescue nil
29
+ `git rev-parse HEAD 2> #{File::NULL}`.strip rescue nil
30
30
  end
31
31
  end
32
32
  end
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # The current String Honeybadger version.
3
- VERSION = '4.7.2'.freeze
3
+ VERSION = '4.8.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.2
4
+ version: 4.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email:
@@ -135,7 +135,7 @@ homepage: https://github.com/honeybadger-io/honeybadger-ruby
135
135
  licenses:
136
136
  - MIT
137
137
  metadata: {}
138
- post_install_message:
138
+ post_install_message:
139
139
  rdoc_options:
140
140
  - "--markup=tomdoc"
141
141
  - "--main=README.md"
@@ -153,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  - !ruby/object:Gem::Version
154
154
  version: '0'
155
155
  requirements: []
156
- rubygems_version: 3.1.2
157
- signing_key:
156
+ rubygems_version: 3.1.4
157
+ signing_key:
158
158
  specification_version: 4
159
159
  summary: Error reports you can be happy about.
160
160
  test_files: []