kennel 1.111.0 → 1.112.1

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: ecc8b3b6c87887c18c48a47ef287b7d96a79a12b11f3e76122b95733dfcb53bc
4
- data.tar.gz: 335c63f8cb7b01437286a0d5a1e2bfdcc409af5ff98d3743cb485e06c4d63963
3
+ metadata.gz: 4afd2070d0b8c2097b1e67b0ad6b1f72928058370066d463da37f4b3340d903a
4
+ data.tar.gz: b11721c83b65f8af2749faef9a967691fafe235e85214fa15163b4341b00d928
5
5
  SHA512:
6
- metadata.gz: 8805038348b44ad5a9615642b6862d6a99dea7d630dd4bc2a2d93448d59d394bf23f714ef46a159c0150f34105b4a8553c4ea09d63b0a0fdc811ac6919a6de04
7
- data.tar.gz: 93a9924e1c1d575d110e4e90b10124f7157a18f384284fb190af267ca19580d93e33b9816708429804195450b4865918e63a507dc65e1fcb84885c2b94122e23
6
+ metadata.gz: 8d75553fdb2b17fc63e4cac6f7b56290d25756848109b4bc015125e1369cfbb624c270d46f108f502c2dca6c55de64bc2d63c606d8b259f3f97fe7bba7b7700f
7
+ data.tar.gz: f63b3f9d0a4d273f189ae55d50e4e477bf7a7ca4a88474a97771592ede2080b6a4ab3aa815a76def48951d43b092db5eb880dd64acce0de69bcb51aa1c1d0e32
@@ -8,6 +8,9 @@ module Kennel
8
8
  :deleted, :id, :created, :created_at, :creator, :org_id, :modified, :modified_at,
9
9
  :klass, :tracking_id # added by syncer.rb
10
10
  ].freeze
11
+ ALLOWED_KENNEL_ID_CHARS = "a-zA-Z_\\d.-"
12
+ ALLOWED_KENNEL_ID_FULL = "[#{ALLOWED_KENNEL_ID_CHARS}]+:[#{ALLOWED_KENNEL_ID_CHARS}]+"
13
+ ALLOWED_KENNEL_ID_REGEX = /\A#{ALLOWED_KENNEL_ID_FULL}\z/.freeze
11
14
 
12
15
  settings :id, :kennel_id
13
16
 
@@ -25,7 +28,7 @@ module Kennel
25
28
  end
26
29
 
27
30
  def parse_tracking_id(a)
28
- a[self::TRACKING_FIELD].to_s[/-- Managed by kennel (\S+:\S+)/, 1]
31
+ a[self::TRACKING_FIELD].to_s[/-- Managed by kennel (#{ALLOWED_KENNEL_ID_FULL})/, 1]
29
32
  end
30
33
 
31
34
  # TODO: combine with parse into a single method or a single regex
@@ -76,7 +79,9 @@ module Kennel
76
79
  def tracking_id
77
80
  @tracking_id ||= begin
78
81
  id = "#{project.kennel_id}:#{kennel_id}"
79
- raise ValidationError, "#{id} kennel_id cannot include whitespace" if id.match?(/\s/) # <-> parse_tracking_id
82
+ unless id.match?(ALLOWED_KENNEL_ID_REGEX) # <-> parse_tracking_id
83
+ raise ValidationError, "#{id} must match #{ALLOWED_KENNEL_ID_REGEX}"
84
+ end
80
85
  id
81
86
  end
82
87
  end
@@ -53,11 +53,11 @@ module Kennel
53
53
  super
54
54
 
55
55
  # tags come in a semi-random order and order is never updated
56
- expected[:tags]&.sort!
57
- actual[:tags]&.sort!
56
+ expected[:tags] = expected[:tags]&.sort
57
+ actual[:tags] = actual[:tags]&.sort
58
58
 
59
- expected[:locations]&.sort!
60
- actual[:locations]&.sort!
59
+ expected[:locations] = expected[:locations]&.sort
60
+ actual[:locations] = actual[:locations]&.sort
61
61
 
62
62
  ignore_default(expected, actual, DEFAULTS)
63
63
  end
data/lib/kennel/utils.rb CHANGED
@@ -149,7 +149,7 @@ module Kennel
149
149
  # TODO: use awesome-print or similar, but it has too many monkey-patches
150
150
  # https://github.com/amazing-print/amazing_print/issues/36
151
151
  def pretty_inspect(object)
152
- string = object.inspect
152
+ string = object.inspect.dup
153
153
  string.gsub!(/:([a-z_]+)=>/, "\\1: ")
154
154
  10.times do
155
155
  string.gsub!(/{(\S.*?\S)}/, "{ \\1 }") || break
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.111.0"
3
+ VERSION = "1.112.1"
4
4
  end
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.111.0
4
+ version: 1.112.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  requirements: []
120
- rubygems_version: 3.2.16
120
+ rubygems_version: 3.0.3
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Keep datadog monitors/dashboards/etc in version control, avoid chaotic management