gitlab_support_readiness 1.0.108 → 1.0.110

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: 4a2cb19720a44f7245b049d8ee2674c7c659f7cf080b661191ebc877396cdb25
4
- data.tar.gz: 13acfef23cba114734bfb6bcf030c081bcbab04593fdbde064f4324841548a36
3
+ metadata.gz: bcaad3ddf5dae80d44628c64919b1816fdcf5b9f55bcaf16be572abda1d39f40
4
+ data.tar.gz: a4e96419eda25a20c671d05ad98b4b368bd32a9585eb3d078cfdfb8f670100c5
5
5
  SHA512:
6
- metadata.gz: 49830cf4950318a3516003bc1f6fd5b1035345c96e10983949fac76e279c6880dab0462d1d66291094d37b1d57e3d4de58af034b2eff2dfb5e06318722a9d257
7
- data.tar.gz: e280315a3e4a62a8a291ca943ec6d6474f6754805a454b5f61d9513134f6e34e0b45ff5e0e3e7dd2536d579d9ecae6b794b8c78b87a2d275f6787b76488e2c79
6
+ metadata.gz: e0f612510cf7978298d2efdd89c7f7472c8662a5de27be23a81ad4bcf6741ef3265cb9c6ce74d4c0cd843895f17ead184c7dc2a12468b7fa22a115a878007536
7
+ data.tar.gz: e0541f1e0afc68ae449e67511d929a77eda037d5e9c5b29bd81eee49e15bc91748ba7447a905b60684125fd1e6b2def101746071241b7471129db6eebac73614
@@ -118,7 +118,10 @@ module Readiness
118
118
  # # => "https://gitlab.com/gitlab-com/support/support-team-meta/-/issues/5"
119
119
  def self.find(client, group, iid)
120
120
  response = client.connection.get "groups/#{group.id}/epics/#{iid}"
121
- handle_request_error(0, 'GitLab', response.status, { action: 'get', id: epic_id }) unless response.status == 200
121
+ # These endpoints throw a 403 instead of 404 when it does not exist
122
+ return { "message" => "Epic not found" } if response.status == 403
123
+
124
+ handle_request_error(0, 'GitLab', response.status, { action: 'get', id: iid }) unless response.status == 200
122
125
  return Epics.new(Oj.load(response.body)) if response.status == 200
123
126
 
124
127
  Oj.load(response.body)
@@ -145,6 +148,8 @@ module Readiness
145
148
  # # => "https://gitlab.com/gitlab-com/support/support-team-meta/-/issues/5"
146
149
  def self.find!(client, group, iid)
147
150
  response = client.connection.get "groups/#{group.id}/epics/#{iid}"
151
+ # These endpoints throw a 403 instead of 404 when it does not exist
152
+ handle_request_error(1, 'GitLab', 404, { action: 'Find epic', id: iid }) if response.status == 403
148
153
  handle_request_error(1, 'GitLab', response.status, { action: 'Find epic', id: iid }) unless response.status == 200
149
154
  Epics.new(Oj.load(response.body))
150
155
  end
@@ -174,6 +174,15 @@ module Readiness
174
174
  def self.convert_names_to_ids(trigger)
175
175
  %w[any all].each do |type|
176
176
  trigger['conditions'][type].each_with_index do |c, i|
177
+ if c['field'] == 'organization_id'
178
+ code = c['value']
179
+ next unless code.to_i.zero?
180
+
181
+ search = Readiness::Zendesk::Search.organizations(@zendesk_client, "salesforce_id:#{code}")
182
+ if search.count == 1
183
+ trigger['conditions'][type][i]['value'] = search.first.id.to_s
184
+ end
185
+ end
177
186
  if c['field'] == 'satisfaction_reason_code'
178
187
  reason = Readiness::Zendesk::SatisfactionReasons.find_by_name(@zendesk_client, c['value'], @satisfaction_reasons)
179
188
  unless reason.nil?
@@ -226,6 +235,13 @@ module Readiness
226
235
  end
227
236
  end
228
237
  trigger['actions'].each_with_index do |a, i|
238
+ if a['field'] == 'organization_id'
239
+ code = a['value']
240
+ search = Readiness::Zendesk::Search.organizations(@zendesk_client, "salesforce_id:#{code}")
241
+ if search.count == 1
242
+ trigger['actions'][i]['value'][0] = search.first.id.to_s
243
+ end
244
+ end
229
245
  if a['field'] == 'notification_target'
230
246
  if a['value'].first =~ /^Target\:\ /
231
247
  name = a['value'].first.split('Target: ').last
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.108
4
+ version: 1.0.110
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-01-27 00:00:00.000000000 Z
11
+ date: 2025-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport