kennel 1.102.0 → 1.102.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: 424978ab5e025d68c1b30adee8dcf9bbae531c34da1ce02abcc1a97165accb2f
4
- data.tar.gz: 762d7b47d15937d0ea9b2bb7d9bb1c79d88b34828a0b455c05aa4d7498fd8f04
3
+ metadata.gz: a2bb74d0c3edadadde342a244ba9978b571da0a2306b8c5aacaafd60a745f431
4
+ data.tar.gz: abbb833ba16df03e64e2fea46c4094b7ad2aa07780c13e0cebe981f9c77e4753
5
5
  SHA512:
6
- metadata.gz: 2079300fb176ffe4a3c363c56dfb2fed0901b4f3cfce7ff6fd1c656f8981e16a94628eaa660ffee6a53cc86c9df2d7b604ca877c6c34c61eeec13cbe4b0484ee
7
- data.tar.gz: 0113a4f7a4edf4813d66cb15090909e63a47945cfaa4bce22cd9fe40203f3b6dd3705c2f62652df7e09be9e4b7a7d5de1de2092074e2baa524c8392a3bb9b462
6
+ metadata.gz: d0aea7c75a482f3a4a2d4996bca4c3b2990564f3720f027366749b5c287f50bc805e29782315e697a2711f5029f9aecbda05b4aae0b1f6204d371f6991e6e76b
7
+ data.tar.gz: 47037941ef3eedbefb74061545ea68c62d36367ec2b24a3acd3e6e2e08aaa9ef44f2735482012aa4af202aca5ee2cf2330af9df40ee717500d01c43940c9e436
data/lib/kennel/id_map.rb CHANGED
@@ -15,10 +15,6 @@ module Kennel
15
15
  @map[type][tracking_id] = id
16
16
  end
17
17
 
18
- def set_new(type, tracking_id)
19
- @map[type][tracking_id] = NEW
20
- end
21
-
22
18
  def new?(type, tracking_id)
23
19
  @map[type][tracking_id] == NEW
24
20
  end
data/lib/kennel/syncer.rb CHANGED
@@ -254,15 +254,28 @@ module Kennel
254
254
  end
255
255
 
256
256
  def populate_id_map(expected, actual)
257
+ # mark everything as new
257
258
  expected.each do |e|
258
- @id_map.set_new(e.class.api_resource, e.tracking_id)
259
+ @id_map.set(e.class.api_resource, e.tracking_id, IdMap::NEW)
260
+ if e.class.api_resource == "synthetics/tests"
261
+ @id_map.set(Kennel::Models::Monitor.api_resource, e.tracking_id, IdMap::NEW)
262
+ end
259
263
  end
260
264
 
265
+ # override resources that exist with their id
266
+ project_prefix = @project_filter && "#{@project_filter}:"
261
267
  actual.each do |a|
268
+ # ignore when not managed by kennel
262
269
  next unless tracking_id = a.fetch(:tracking_id)
263
- next unless @id_map.get(a.fetch(:klass).api_resource, tracking_id)
264
270
 
265
- @id_map.set(a.fetch(:klass).api_resource, tracking_id, a.fetch(:id))
271
+ # ignore when deleted from the codebase
272
+ # (when running with project filter we cannot see the other resources in the codebase)
273
+ api_resource = a.fetch(:klass).api_resource
274
+ next if
275
+ !@id_map.get(api_resource, tracking_id) &&
276
+ (!project_prefix || tracking_id.start_with?(project_prefix))
277
+
278
+ @id_map.set(api_resource, tracking_id, a.fetch(:id))
266
279
  if a[:klass].api_resource == "synthetics/tests"
267
280
  @id_map.set(Kennel::Models::Monitor.api_resource, tracking_id, a.fetch(:monitor_id))
268
281
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.102.0"
3
+ VERSION = "1.102.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.102.0
4
+ version: 1.102.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: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2021-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday