kennel 2.18.0 → 2.18.2
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/Readme.md +1 -0
- data/lib/kennel/api.rb +7 -2
- data/lib/kennel/models/monitor.rb +1 -1
- data/lib/kennel/syncer.rb +2 -1
- data/lib/kennel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a3078b16009b136fcbc16ea73f8840db57aeb16e63c38faf3778207865693ea
|
|
4
|
+
data.tar.gz: 7f12c25f2388e145dd66fe59c808a97371248ad3848760152562b7637c07bb14
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 391adb884ea9df702d30af303787e4ec9a674ed37b4f4ff968f4e3fec286410d48cca6b12e45a25c493a63b22153628ac2c0233adf59f3f3c66323fe08e62a5e
|
|
7
|
+
data.tar.gz: 968dd89cc955d25bf46ce53310331ce280e7a24f98f100c51cc1b0d20607ab3884733d091c0b9865f7f3208e44a4e4290fdfc006a59b8f2be4c7898af628d409
|
data/Readme.md
CHANGED
|
@@ -487,6 +487,7 @@ rake kennel:tracking_id ID=123 RESOURCE=monitor
|
|
|
487
487
|
| `KENNEL_API_CACHE_FILE` | Path to the API cache file for dashboard details. | `tmp/cache/details` |
|
|
488
488
|
| `KENNEL_NO_GENERATE` | When set, skip generating files during `plan` or `update_datadog`. Useful when generated files are already up to date. | - |
|
|
489
489
|
| `NO_IGNORED_ERRORS` | When set, show all validation errors including ones suppressed via `ignored_errors`. | - |
|
|
490
|
+
| `SHOW_UNCACHED_FILL_DETAILS` | When set, print the number of uncached dashboard `show` requests made to fill details during diffing. | - |
|
|
490
491
|
|
|
491
492
|
### Integration testing
|
|
492
493
|
```Bash
|
data/lib/kennel/api.rb
CHANGED
|
@@ -74,7 +74,7 @@ module Kennel
|
|
|
74
74
|
# fill the resource with the full response from the `show` if `list` does not return it
|
|
75
75
|
def fill_details!(api_resource, list)
|
|
76
76
|
details_cache do |cache|
|
|
77
|
-
Utils.parallel(list) { |a| fill_detail!(api_resource, a, cache) }
|
|
77
|
+
Utils.parallel(list) { |a| fill_detail!(api_resource, a, cache) }.sum
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
80
|
|
|
@@ -97,9 +97,14 @@ module Kennel
|
|
|
97
97
|
|
|
98
98
|
# Make diff work even though we cannot mass-fetch definitions
|
|
99
99
|
def fill_detail!(api_resource, a, cache)
|
|
100
|
+
uncached = 0
|
|
100
101
|
args = [api_resource, a.fetch(:id)]
|
|
101
|
-
full = cache.fetch(args, a.fetch(:modified_at))
|
|
102
|
+
full = cache.fetch(args, a.fetch(:modified_at)) do
|
|
103
|
+
uncached += 1
|
|
104
|
+
show(*args)
|
|
105
|
+
end
|
|
102
106
|
a.merge!(full)
|
|
107
|
+
uncached
|
|
103
108
|
end
|
|
104
109
|
|
|
105
110
|
def details_cache(&block)
|
|
@@ -357,7 +357,7 @@ module Kennel
|
|
|
357
357
|
message = data.fetch(:message)
|
|
358
358
|
|
|
359
359
|
used =
|
|
360
|
-
message.scan(/{{\s*(?:[#^]is(?:_exact)?_match)\s*"([^\s}]+)"/) + # {{#is_match "environment.name" "production"}}
|
|
360
|
+
message.scan(/{{\s*(?:[#^]is(?:_exact)?_match)\s*['"]([^\s}]+)['"]/) + # {{#is_match "environment.name" "production"}}
|
|
361
361
|
message.scan(/{{\s*([^}]+\.name)\s*}}/) # Pod {{pod.name}} failed
|
|
362
362
|
return if used.empty?
|
|
363
363
|
used.flatten!(1)
|
data/lib/kennel/syncer.rb
CHANGED
|
@@ -93,7 +93,8 @@ module Kennel
|
|
|
93
93
|
convert_replace_into_update!(matching, unmatched_actual, unmatched_expected)
|
|
94
94
|
|
|
95
95
|
validate_expected_id_not_missing unmatched_expected
|
|
96
|
-
fill_details! matching # need details to diff later
|
|
96
|
+
uncached = fill_details! matching # need details to diff later
|
|
97
|
+
Kennel.out.puts "Uncached dashboard gets to fill details: #{uncached}" if ENV["SHOW_UNCACHED_FILL_DETAILS"]
|
|
97
98
|
|
|
98
99
|
# update matching if needed
|
|
99
100
|
updates = matching.map do |e, a|
|
data/lib/kennel/version.rb
CHANGED