rails-informant 0.4.1 → 0.4.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 241dedb8b97e9cc3b60ad1275e6bfd61393fd07b253599c3f3b7cad7829dc2dc
4
- data.tar.gz: 6b2f6737c9464c416c154ceceecf94c4226419d3f3a84c4a8987216bbeb7cd86
3
+ metadata.gz: de6c6a1e4797ad9aa7ceb4f44bbe3555030872c05e2fa2d4f5fc3a89c1585add
4
+ data.tar.gz: d9a7e18f30c905a304e881d4ab0bb39290db5efac899aa0bb6eb54e1b92c55af
5
5
  SHA512:
6
- metadata.gz: 80ba0bbe5494c3af170c392bd869c5dd2e9d573223fa4c10ddaab315c5dd8961b12d1958245f242e9670b5b1ab4fb4dba7b0ad04177cd7d992b0840d8b2ba8de
7
- data.tar.gz: a408c05da27d4c37d1f557bc8f9fc52bb81202909fdcf4abb37862d7b14ac86c3c17f558546c6df77767507f45da894eb5ae6da317d1116dba93ab816b44c343
6
+ metadata.gz: 8b96cd324074c8a40e53704d24e2e52e74ef5b9f1f7b00a172fd3fc7c22650bdda50255d6a4f88921b12eaad168bf7ae29feba40eaeee1e003910ea977f4f836
7
+ data.tar.gz: c6941002dceb643128d7549c0a1862d97d97a26a36b15fad28db592bdd33734b370c13773dfca97c53ec34b06470e774d00c9382514162af7b309132e6132ec3
@@ -9,6 +9,7 @@ module RailsInformant
9
9
  module NotificationPolicy
10
10
  COOLDOWN = 1.hour
11
11
  MILESTONE_COUNTS = [ 10, 100, 1000 ].freeze
12
+ SILENT_STATUSES = %w[duplicate ignored].freeze
12
13
 
13
14
  PRIVATE_NETWORKS = [
14
15
  IPAddr.new("0.0.0.0/8"), # "This" network
@@ -30,6 +31,7 @@ module RailsInformant
30
31
  ].freeze
31
32
 
32
33
  def should_notify?(error_group)
34
+ return false if error_group.status.in?(SILENT_STATUSES)
33
35
  return true if error_group.total_occurrences == 1
34
36
  return true if error_group.total_occurrences.in?(MILESTONE_COUNTS)
35
37
  return true if error_group.last_notified_at.nil?
@@ -156,6 +156,12 @@ module RailsInformant
156
156
  return ENV[key] if ENV[key].present?
157
157
  end
158
158
 
159
+ revision_path = Rails.root.join("REVISION")
160
+ if revision_path.exist?
161
+ content = revision_path.read.strip
162
+ return content.match?(SHA_FORMAT) ? content : nil
163
+ end
164
+
159
165
  head = Rails.root.join(".git", "HEAD").read.strip
160
166
  if head.start_with?("ref: ")
161
167
  ref = head.delete_prefix("ref: ")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-informant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel López Prat