kennel 1.76.3 → 1.77.0

This diff has not been reviewed by any users.
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: 17d17b2d23505b0d282fcab382a0bb43f452a132826c35a9fead4544631457db
4
- data.tar.gz: d27f3363aafacb7885f833cf0c5d0d925d0b15f22a4d4aced5ff41377375b333
3
+ metadata.gz: e6ac506da0670019c4f9bfeedda08ff728a0522b86a4e65356ef75b806ac1a33
4
+ data.tar.gz: e19bca2c80a775ba5a28a480b7b265246c0aa00699eec87147ef9d1b7725b603
5
5
  SHA512:
6
- metadata.gz: f5558fd02af6b9662955686724c4c406e23393de685ca5db815f02470439d1ece2f446400b154fdd700ac7d71507500022f4b0c1527e9f0b8769fcf99edfe699
7
- data.tar.gz: 3969b3ae9a00f29bc9882ba4395b019d70e3562cbc2b2c6beca72a65352167d47c80fab7b560183a62c312f24f2ec7b147cf30385877b63044e137d26b7e65a3
6
+ metadata.gz: c29f4797475eb5f83eb7d3b5a35af710267eff90263764e0611f6d2bb52b75d3af34c3fdc7423e0945b2c0741c94bed3480152a17ef73b301877592d93c138c4
7
+ data.tar.gz: bbe104daf2fc7962fa95d94ce6b44b098ddd40461354717d99c0483f5672659a71ebaeaecaad32a28406161b8cd6ff726deefbf6986063b36e7eeb6e0edd60e5
data/Readme.md CHANGED
@@ -210,6 +210,7 @@ To link to existing monitors via their kennel_id `projects kennel_id` + `:` + `m
210
210
  - Screens `uptime` widgets can use `monitor: {id: "foo:bar"}`
211
211
  - Screens `alert_graph` widgets can use `alert_id: "foo:bar"`
212
212
  - Monitors `composite` can use `query: -> { "%{foo:bar} || %{foo:baz}" }`
213
+ - Slos can use `monitor_ids: -> ["foo:bar"]`
213
214
 
214
215
  ### Debugging changes locally
215
216
 
@@ -192,7 +192,7 @@ module Kennel
192
192
  end
193
193
 
194
194
  if type == "query alert"
195
- # verify interval is valud
195
+ # verify interval is valid
196
196
  interval = data.fetch(:query)[/\(last_(\S+?)\)/, 1]
197
197
  if interval && !QUERY_INTERVALS.include?(interval)
198
198
  invalid! "query interval was #{interval}, but must be one of #{QUERY_INTERVALS.join(", ")}"
@@ -200,13 +200,17 @@ module Kennel
200
200
  end
201
201
 
202
202
  if ["query alert", "service check"].include?(type) # TODO: most likely more types need this
203
- # verify is_match uses available variables
203
+ # verify is_match/is_exact_match uses available variables
204
204
  message = data.fetch(:message)
205
- used = message.scan(/{{\s*#is_match\s*"([a-zA-Z\d_.-]+).name"/).flatten.uniq
206
- allowed = data.fetch(:query)[/by\s*[({]([^})]+)[})]/, 1].to_s.gsub(/["']/, "").split(/\s*,\s*/)
207
- unsupported = used - allowed
208
- if unsupported.any?
209
- invalid! "is_match used with #{unsupported}, but metric is only grouped by #{allowed}"
205
+ used = message.scan(/{{\s*([#^]is(?:_exact)?_match)\s*([^\s}]+)/)
206
+ if used.any?
207
+ allowed = data.fetch(:query)[/by\s*[({]([^})]+)[})]/, 1]
208
+ .to_s.gsub(/["']/, "").split(/\s*,\s*/)
209
+ .map! { |w| %("#{w}.name") }
210
+ used.uniq.each do |match, group|
211
+ next if allowed.include?(group)
212
+ invalid! "#{match} used with #{group}, but can only be used with #{allowed.join(", ")}. Add more groupings or fix the #{match}"
213
+ end
210
214
  end
211
215
  end
212
216
  end
@@ -38,7 +38,7 @@ module Kennel
38
38
  end
39
39
 
40
40
  def update
41
- changed = (@create + @update).map { |_, e| e } unless @create.empty?
41
+ changed = (@create + @update).map { |_, e| e }
42
42
 
43
43
  @create.each do |_, e|
44
44
  e.resolve_linked_tracking_ids!({}, force: true)
@@ -188,7 +188,7 @@ module Kennel
188
188
  end
189
189
 
190
190
  # Do not add tracking-id when working with existing ids on a branch,
191
- # so resource do not get deleted fr:om merges to master.
191
+ # so resource do not get deleted from running an update on master (for example merge->CI).
192
192
  # Also make sure the diff still makes sense, by kicking out the now noop-update.
193
193
  #
194
194
  # Note: ideally we'd never add tracking in the first place, but at that point we do not know the diff yet
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.76.3"
3
+ VERSION = "1.77.0"
4
4
  end
@@ -192,6 +192,7 @@ To link to existing monitors via their kennel_id `projects kennel_id` + `:` + `m
192
192
  - Screens `uptime` widgets can use `monitor: {id: "foo:bar"}`
193
193
  - Screens `alert_graph` widgets can use `alert_id: "foo:bar"`
194
194
  - Monitors `composite` can use `query: -> { "%{foo:bar} || %{foo:baz}" }`
195
+ - Slos can use `monitor_ids: -> ["foo:bar"]`
195
196
 
196
197
  ### Debugging changes locally
197
198
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.76.3
4
+ version: 1.77.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday