kennel 1.84.0 → 1.86.0
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 +4 -4
- data/lib/kennel/importer.rb +3 -0
- data/lib/kennel/models/dashboard.rb +5 -2
- data/lib/kennel/tasks.rb +3 -1
- data/lib/kennel/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 407f7b02a00450c157052f267383507869dc029a97a9f2cadd7b812f282e218c
|
|
4
|
+
data.tar.gz: b8b3c8b9a9126295d8822d741effd2aed43617d4a5dee6984f99b4b3ed678492
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a1d583dd09886baed89dc44bfa1dc90f1021dd3b2621c676b29b04dc8641a1ae63cd0efd1e9e05c4bfabfcfaeeaf51d9132f97c61703c3df6d5bc31b2bffdfb
|
|
7
|
+
data.tar.gz: 6a9bd44540113a5c481eb5d17a31173018694a02abecd635519cba61415783af519f83ebf449a3e935b2fd227972b75e1c6792e2d3589a31c513bd97b3f10bb9
|
data/lib/kennel/importer.rb
CHANGED
|
@@ -60,6 +60,9 @@ module Kennel
|
|
|
60
60
|
query.sub!(/([><=]) (#{Regexp.escape(critical.to_f.to_s)}|#{Regexp.escape(critical.to_i.to_s)})$/, "\\1 \#{critical}")
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
# using float in query is not allowed, so convert here
|
|
64
|
+
data[:critical] = data[:critical].to_i if data[:type] == "event alert"
|
|
65
|
+
|
|
63
66
|
data[:type] = "query alert" if data[:type] == "metric alert"
|
|
64
67
|
when "dashboard"
|
|
65
68
|
widgets = data[:widgets]&.flat_map { |widget| widget.dig(:definition, :widgets) || [widget] }
|
|
@@ -5,7 +5,6 @@ module Kennel
|
|
|
5
5
|
include TemplateVariables
|
|
6
6
|
include OptionalValidations
|
|
7
7
|
|
|
8
|
-
DASHBOARD_DEFAULTS = { template_variables: [] }.freeze
|
|
9
8
|
READONLY_ATTRIBUTES = superclass::READONLY_ATTRIBUTES + [
|
|
10
9
|
:author_handle, :author_name, :modified_at, :url, :is_read_only, :notify_list
|
|
11
10
|
]
|
|
@@ -22,13 +21,14 @@ module Kennel
|
|
|
22
21
|
template_variable_presets: nil
|
|
23
22
|
}.freeze
|
|
24
23
|
|
|
25
|
-
settings :title, :description, :definitions, :widgets, :layout_type, :template_variable_presets
|
|
24
|
+
settings :title, :description, :definitions, :widgets, :layout_type, :template_variable_presets, :reflow_type
|
|
26
25
|
|
|
27
26
|
defaults(
|
|
28
27
|
description: -> { "" },
|
|
29
28
|
definitions: -> { [] },
|
|
30
29
|
widgets: -> { [] },
|
|
31
30
|
template_variable_presets: -> { DEFAULTS.fetch(:template_variable_presets) },
|
|
31
|
+
reflow_type: -> { layout_type == "ordered" ? "auto" : nil },
|
|
32
32
|
id: -> { nil }
|
|
33
33
|
)
|
|
34
34
|
|
|
@@ -41,6 +41,7 @@ module Kennel
|
|
|
41
41
|
super
|
|
42
42
|
|
|
43
43
|
ignore_default(expected, actual, DEFAULTS)
|
|
44
|
+
ignore_default(expected, actual, reflow_type: "auto") if expected[:layout_type] == "ordered"
|
|
44
45
|
|
|
45
46
|
widgets_pairs(expected, actual).each do |pair|
|
|
46
47
|
# conditional_formats ordering is randomly changed by datadog, compare a stable ordering
|
|
@@ -116,6 +117,8 @@ module Kennel
|
|
|
116
117
|
widgets: all_widgets
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
@json[:reflow_type] = reflow_type if reflow_type # setting nil breaks create with "ordered"
|
|
121
|
+
|
|
119
122
|
@json[:id] = id if id
|
|
120
123
|
|
|
121
124
|
validate_json(@json) if validate
|
data/lib/kennel/tasks.rb
CHANGED
|
@@ -158,7 +158,9 @@ namespace :kennel do
|
|
|
158
158
|
found.each do |resource|
|
|
159
159
|
if ENV["URLS"]
|
|
160
160
|
parsed = JSON.parse(resource)
|
|
161
|
-
|
|
161
|
+
url = models[parsed.fetch("api_resource")].url(parsed.fetch("id"))
|
|
162
|
+
title = parsed["title"] || parsed["name"]
|
|
163
|
+
Kennel.out.puts "#{url} # #{title}"
|
|
162
164
|
else
|
|
163
165
|
Kennel.out.puts resource
|
|
164
166
|
end
|
data/lib/kennel/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.86.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: 2021-
|
|
11
|
+
date: 2021-04-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -94,14 +94,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
94
94
|
requirements:
|
|
95
95
|
- - ">="
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: 2.
|
|
97
|
+
version: 2.6.0
|
|
98
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - ">="
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
102
|
version: '0'
|
|
103
103
|
requirements: []
|
|
104
|
-
rubygems_version: 3.
|
|
104
|
+
rubygems_version: 3.2.16
|
|
105
105
|
signing_key:
|
|
106
106
|
specification_version: 4
|
|
107
107
|
summary: Keep datadog monitors/dashboards/etc in version control, avoid chaotic management
|