kennel 1.145.0 → 1.146.0

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: ed091ba0fa4fda310e5444a6e01fd21cf03f2b19dee5c7d4b0988a61855ca28e
4
- data.tar.gz: 8a720d21972b01c5863722bf56834eccbcaf91ebcd949512142239afa364ec77
3
+ metadata.gz: 135900ecb21e1299d4b8fb044235e58363e94b19739d782eb13a3b37f3ebec01
4
+ data.tar.gz: 9333524bd316ca81abbf42eb678d7c6fb9558bc7ad03e61534eb268e8a7d487e
5
5
  SHA512:
6
- metadata.gz: e478b0fea488349ef09f1402f146d5d1383849f292b34fd9575378abdb547d1de00124f9063a0e4dab5f80749470013d22416198db912723cd23e2588ffdf2dc
7
- data.tar.gz: f64c88e17f5b1e016c8e8503b9e098bdaf56167b5d9084c4245199bad52fd142253b9f672647597fb24c0dd4b798c1382f9b45eeaaf1cdc76c4cc04fdeb70956
6
+ metadata.gz: 6d935709f003f87021baae50e8dbc5701bdf98abb9a1b34562669a953ca768e1bcc6354d8eb2f006b0b16514091a550b23bef855b194027bc0179a070354be80
7
+ data.tar.gz: e4fce646569437007d027fbacfd0086a909f382a861f5c90c938251822b8fd0a1f0072af799d1cfcb1f5d8d570d0ec895a3e3d9ba5c1375ddf5ef6c9f7c29f85
data/Readme.md CHANGED
@@ -171,7 +171,7 @@ for simple constants you may prefer to use the plain syntax (`critical: 5.0`).
171
171
  - `cp .env.example .env`
172
172
  - open [Datadog API Settings](https://app.datadoghq.com/account/settings#api)
173
173
  - create a `API Key` or get an existing one from an admin, then add it to `.env` as `DATADOG_API_KEY`
174
- - open [Datadog API Settings](https://app.datadoghq.com/access/application-keys) and create a new key, then add it to `.env` as `DATADOG_APP_KEY=`
174
+ - open [Datadog API Settings](https://app.datadoghq.com/personal-settings/application-keys) and create a new key, then add it to `.env` as `DATADOG_APP_KEY=`
175
175
  - if you have a custom subdomain, change the `DATADOG_SUBDOMAIN=app` in `.env`
176
176
  - verify it works by running `rake plan`, it might show some diff, but should not crash
177
177
  -->
data/lib/kennel/syncer.rb CHANGED
@@ -62,22 +62,28 @@ module Kennel
62
62
  Kennel.out.puts "#{LINE_UP}Deleted #{message}"
63
63
  end
64
64
 
65
- resolver.each_resolved internal_plan.creates do |item|
66
- message = "#{item.api_resource} #{item.tracking_id}"
67
- Kennel.out.puts "Creating #{message}"
68
- reply = @api.create item.api_resource, item.expected.as_json
69
- id = reply.fetch(:id)
70
- changes << item.change(id)
71
- resolver.add_actual [reply] # allow resolving ids we could previously not resolve
72
- Kennel.out.puts "#{LINE_UP}Created #{message} #{item.url(id)}"
73
- end
74
-
75
- resolver.each_resolved internal_plan.updates do |item|
76
- message = "#{item.api_resource} #{item.tracking_id} #{item.url}"
77
- Kennel.out.puts "Updating #{message}"
78
- @api.update item.api_resource, item.id, item.expected.as_json
79
- changes << item.change
80
- Kennel.out.puts "#{LINE_UP}Updated #{message}"
65
+ planned_actions = internal_plan.creates + internal_plan.updates
66
+
67
+ # slos need to be updated first in case their timeframes changed
68
+ # because datadog validates that update+create of slo alerts match an existing timeframe
69
+ planned_actions.sort_by! { |item| item.expected.is_a?(Models::Slo) ? 0 : 1 }
70
+
71
+ resolver.each_resolved(planned_actions) do |item|
72
+ if item.is_a?(Types::PlannedCreate)
73
+ message = "#{item.api_resource} #{item.tracking_id}"
74
+ Kennel.out.puts "Creating #{message}"
75
+ reply = @api.create item.api_resource, item.expected.as_json
76
+ id = reply.fetch(:id)
77
+ changes << item.change(id)
78
+ resolver.add_actual [reply] # allow resolving ids we could previously not resolve
79
+ Kennel.out.puts "#{LINE_UP}Created #{message} #{item.url(id)}"
80
+ else
81
+ message = "#{item.api_resource} #{item.tracking_id} #{item.url}"
82
+ Kennel.out.puts "Updating #{message}"
83
+ @api.update item.api_resource, item.id, item.expected.as_json
84
+ changes << item.change
85
+ Kennel.out.puts "#{LINE_UP}Updated #{message}"
86
+ end
81
87
  end
82
88
 
83
89
  Plan.new(changes: changes)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.145.0"
3
+ VERSION = "1.146.0"
4
4
  end
data/template/Readme.md CHANGED
@@ -154,7 +154,7 @@ for simple constants you may prefer to use the plain syntax (`critical: 5.0`).
154
154
  - `cp .env.example .env`
155
155
  - open [Datadog API Settings](https://app.datadoghq.com/account/settings#api)
156
156
  - create a `API Key` or get an existing one from an admin, then add it to `.env` as `DATADOG_API_KEY`
157
- - open [Datadog API Settings](https://app.datadoghq.com/access/application-keys) and create a new key, then add it to `.env` as `DATADOG_APP_KEY=`
157
+ - open [Datadog API Settings](https://app.datadoghq.com/personal-settings/application-keys) and create a new key, then add it to `.env` as `DATADOG_APP_KEY=`
158
158
  - if you have a custom subdomain, change the `DATADOG_SUBDOMAIN=app` in `.env`
159
159
  - verify it works by running `rake plan`, it might show some diff, but should not crash
160
160
 
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.145.0
4
+ version: 1.146.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: 2023-10-03 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs