gitlab_support_readiness 1.0.116 → 1.0.117
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/support_readiness/client.rb +36 -0
- data/lib/support_readiness/repos/views.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cf9fab733d81a7aa5c5c5d9e471a0f227c8d18a054c8dc0c9da5f968697a107
|
4
|
+
data.tar.gz: c0203eb2c3522b57969e8ec42b85115e994ebbe619de02024e832e0f9e349e7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41579e75455d37c9139d7df45f2a413cdf5629469e51977af063e1bea5b28c024ce7c8222d4ab6da3a5aa0a4c8f12cf6a11e6fe399fe51702c931be1362465f5
|
7
|
+
data.tar.gz: 1931b9f5d11cf0fdab299ea3a73c31256d73d309510c996a176f598d7bebe1d4df201ef23b3da8b2b45ba61afe5a070fe26b041c81593562b633124351844d3a
|
@@ -403,5 +403,41 @@ module Readiness
|
|
403
403
|
end
|
404
404
|
object
|
405
405
|
end
|
406
|
+
|
407
|
+
##
|
408
|
+
# Convert user friendly Strings into Zendesk values for view objects
|
409
|
+
#
|
410
|
+
# @author Jason Colyer
|
411
|
+
# @since 1.0.117
|
412
|
+
# @param object [Object] The object to parse
|
413
|
+
def self.convert_view_names_to_ids(object)
|
414
|
+
new_object = convert_conditions(object)
|
415
|
+
convert_view_restrictions(new_object)
|
416
|
+
end
|
417
|
+
|
418
|
+
##
|
419
|
+
# Convert user friendly Strings within restrictions into Zendesk values for view objects
|
420
|
+
#
|
421
|
+
# @author Jason Colyer
|
422
|
+
# @since 1.0.117
|
423
|
+
# @param object [Object] The object to parse
|
424
|
+
def self.convert_view_restrictions(object)
|
425
|
+
return object if object['restriction'].nil?
|
426
|
+
|
427
|
+
if object['restriction']['type'] == 'Group'
|
428
|
+
group = Readiness::Zendesk::Groups.find_by_name(@zendesk_client, object['restriction']['id'], @groups)
|
429
|
+
object['restriction']['id'] = group.id unless group.nil?
|
430
|
+
object['restriction']['ids'] = object['restriction']['ids'].map do |i|
|
431
|
+
group = Readiness::Zendesk::Groups.find_by_name(@zendesk_client, i, @groups)
|
432
|
+
group.nil? ? i : group.id
|
433
|
+
end
|
434
|
+
elsif object['restriction']['type'] == 'User'
|
435
|
+
search = Readiness::Zendesk::Search.users(@zendesk_client, "email:#{object['restriction']['id']}")
|
436
|
+
if search.count == 1
|
437
|
+
object['restriction']['id'] = search.first.id
|
438
|
+
end
|
439
|
+
end
|
440
|
+
object
|
441
|
+
end
|
406
442
|
end
|
407
443
|
end
|
@@ -49,6 +49,7 @@ module Readiness
|
|
49
49
|
# pp diffs[:updates.count]
|
50
50
|
# # => 1
|
51
51
|
def self.compare(config, zendesk_client, location = 'data', verbose = false)
|
52
|
+
@zendesk_client = zendesk_client
|
52
53
|
diffs = {
|
53
54
|
updates: [],
|
54
55
|
creates: []
|
@@ -135,12 +136,18 @@ module Readiness
|
|
135
136
|
# pp repo.count
|
136
137
|
# # => 35
|
137
138
|
def self.gather(config, location = 'data')
|
139
|
+
@groups = Readiness::Zendesk::Groups.list(@zendesk_client)
|
140
|
+
@schedules = Readiness::Zendesk::Schedules.list(@zendesk_client)
|
141
|
+
@satisfaction_reasons = Readiness::Zendesk::SatisfactionReasons.list(@zendesk_client)
|
142
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
143
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
138
144
|
@errors = []
|
139
145
|
@location = location
|
140
146
|
array = []
|
141
147
|
Dir["#{@location}/{active,inactive}/*.yaml"].each do |f|
|
142
148
|
object = YAML.safe_load_file(f)
|
143
149
|
object = convert_managed_content(config, object)
|
150
|
+
object = convert_view_names_to_ids(object)
|
144
151
|
validity_check(f, object)
|
145
152
|
object['id'] = nil
|
146
153
|
array.push(Zendesk::Views.new(object))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_support_readiness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.117
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Colyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02-
|
11
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|