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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a5be659ce41cece2b8c4ace52fc05c600fab7f4e528cacdf25d60521d4518ce
4
- data.tar.gz: e8419e2a2b1acf30a67aba25d8d9d690e24f3474e9f37ed6710f20263f2dc1cb
3
+ metadata.gz: 3a3078b16009b136fcbc16ea73f8840db57aeb16e63c38faf3778207865693ea
4
+ data.tar.gz: 7f12c25f2388e145dd66fe59c808a97371248ad3848760152562b7637c07bb14
5
5
  SHA512:
6
- metadata.gz: 3d4d47b8a727b91e1f407a1a775d5059b642eb70b50eb08654b01eff50abda2c9d0c5477f232f470be762f7c211b95a47d413c8ee13b1f1c9c59148f3497a2ef
7
- data.tar.gz: c97e0cbc0aa26dc81d98d1a5bc0c39fc80831a9daa4a34745b203a277ef0d596382a7af4627ce01446ea855e50e78f5ccc964117928bc8964f7c19f1b3cc8e37
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)) { show(*args) }
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|
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "2.18.0"
3
+ VERSION = "2.18.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser