gitlab_support_readiness 1.0.141 → 1.0.143
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dedb582b95b197cbe938018b3a64bb78a1a399974d4273355856e1797f9c94d2
|
4
|
+
data.tar.gz: 50a7ceaf1991b77173d29eba8f6e89e7452d3fd9dbb6a88696cf9486787e0dd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccaedb12e0c2e5da91bff5496ad5c26044dcc6d717e8b7824718e91f986c5783554ff85469697216b1b6baf7928104844aab07d6d9ca9e5eb4dc96f8981a9813
|
7
|
+
data.tar.gz: 657dcbf6fbbac1460918b2f08e158f89b6f5107dfb115ced2d82074c959a004265ae5047ffb636238023a1f2790b9e53aa7ac1d58992f470f93ae8695339c27b
|
@@ -124,9 +124,12 @@ module Readiness
|
|
124
124
|
# @author Jason Colyer
|
125
125
|
# @since 1.0.26
|
126
126
|
def self.global_sync_object(account)
|
127
|
-
subscriptions = account_subscriptions(account)
|
128
|
-
|
129
|
-
|
127
|
+
subscriptions = account_subscriptions(account, 'global')
|
128
|
+
if subscriptions.count.zero?
|
129
|
+
usgov_subs = account_subscriptions(account, 'usgov')
|
130
|
+
# Return nil if it has no global subs but has us gov subs
|
131
|
+
return nil if usgov_subs.count.nonzero?
|
132
|
+
end
|
130
133
|
expiration = account_expiration(account)
|
131
134
|
type = account_type(account, expiration)
|
132
135
|
partner = %w[alliance_partner open_partner select_partner].include?(type)
|
@@ -184,7 +187,7 @@ module Readiness
|
|
184
187
|
# @author Jason Colyer
|
185
188
|
# @since 1.0.26
|
186
189
|
def self.usgov_sync_object(account)
|
187
|
-
subscriptions = account_subscriptions(account)
|
190
|
+
subscriptions = account_subscriptions(account, 'usgov')
|
188
191
|
expiration = account_expiration(account)
|
189
192
|
type = account_type(account, expiration)
|
190
193
|
partner = %w[alliance_partner open_partner select_partner].include?(type)
|
@@ -237,48 +240,87 @@ module Readiness
|
|
237
240
|
#
|
238
241
|
# @author Jason Colyer
|
239
242
|
# @since 1.0.26
|
240
|
-
def self.account_subscriptions(account)
|
243
|
+
def self.account_subscriptions(account, type)
|
241
244
|
subs = []
|
242
245
|
return subs if account.Zuora__R00N40000001lGjTEAU__r.nil?
|
243
246
|
|
244
|
-
account.Zuora__R00N40000001lGjTEAU__r.
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
sub_types
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
sub_types.push('sub_proserv') if SubscriptionDefinitions.proserv.include? sub.Name
|
256
|
-
sub_types.push('sub_dotcom_premium') if SubscriptionDefinitions.dotcom_premium.include? sub.Name
|
257
|
-
sub_types.push('sub_dotcom_ultimate') if SubscriptionDefinitions.dotcom_ultimate.include? sub.Name
|
258
|
-
sub_types.push('sub_sm_starter') if SubscriptionDefinitions.sm_starter.include? sub.Name
|
259
|
-
sub_types.push('sub_sm_premium') if SubscriptionDefinitions.sm_premium.include? sub.Name
|
260
|
-
sub_types.push('sub_sm_ultimate') if SubscriptionDefinitions.sm_ultimate.include? sub.Name
|
261
|
-
sub_types.push('sub_usgov_12x5') if SubscriptionDefinitions.usgov_12x5.include? sub.Name
|
262
|
-
sub_types.push('sub_usgov_24x7') if SubscriptionDefinitions.usgov_24x7.include? sub.Name
|
263
|
-
sub_types.push('sub_gitlab_dedicated') if SubscriptionDefinitions.gitlab_dedicated.include? sub.Name
|
264
|
-
sub_types.push('sub_edu') if SubscriptionDefinitions.edu.include? sub.Name
|
265
|
-
sub_types.push('sub_oss') if SubscriptionDefinitions.oss.include? sub.Name
|
266
|
-
sub_types.push('sub_community_other') if SubscriptionDefinitions.community_other.include? sub.Name
|
267
|
-
sub_types.push('sub_ss_ase') if SubscriptionDefinitions.ss_ase.include? sub.Name
|
268
|
-
sub_types.push('sub_ss_growth') if SubscriptionDefinitions.ss_success_advanced.include? sub.Name
|
269
|
-
sub_types.push('sub_ss_enterprise') if SubscriptionDefinitions.ss_success_signature.include? sub.Name
|
270
|
-
sub_types.push('sub_usgov_24x7') if SubscriptionDefinitions.fedramp.include? sub.Name
|
271
|
-
sub_types.push('sub_gitlab_dedicated') if SubscriptionDefinitions.fedramp.include? sub.Name
|
272
|
-
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '00161000010fYlBAAU' && sub.Name =~ /Success\ Plan\ Services/
|
273
|
-
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '001PL00000S7nT3YAJ' && sub.Name =~ /Success\ Plan\ Services/
|
274
|
-
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '0016100000K8R8fAAF' && sub.Name =~ /Success\ Plan\ Services/
|
275
|
-
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '0014M00001lcEpNQAU' && sub.Name =~ /Success\ Plan\ Services/
|
276
|
-
sub_types.push('sub_other') if sub_types.count.zero?
|
247
|
+
grouped = account.Zuora__R00N40000001lGjTEAU__r.group_by { |z| z.Zuora__Subscription__c }
|
248
|
+
grouped.each_value.each do |charges|
|
249
|
+
valid_charges = charges.select { |c| c.Subscription_Status__c == 'Active' && Date.parse(c.Zuora__EffectiveEndDate__c) >= Date.today }
|
250
|
+
next if valid_charges.count.zero?
|
251
|
+
|
252
|
+
charge_names = valid_charges.map { |x| x.Name }
|
253
|
+
sub_types = if type == 'global'
|
254
|
+
process_global_subs(account, charge_names)
|
255
|
+
else
|
256
|
+
process_usgov_subs(account, charge_names)
|
257
|
+
end
|
277
258
|
subs += sub_types
|
278
259
|
end
|
279
260
|
subs.compact.uniq
|
280
261
|
end
|
281
262
|
|
263
|
+
def self.process_global_subs(account, charge_names)
|
264
|
+
sub_types = []
|
265
|
+
sub_types.push('sub_consumption_cicd_minutes') if charge_names.any? { |x| SubscriptionDefinitions.consumption_cicd_minutes.include?(x) }
|
266
|
+
sub_types.push('sub_consumption_storage') if charge_names.any? { |x| SubscriptionDefinitions.consumption_storage.include?(x) }
|
267
|
+
sub_types.push('sub_dotcom_premium') if charge_names.any? { |x| SubscriptionDefinitions.dotcom_premium.include?(x) }
|
268
|
+
sub_types.push('sub_dotcom_ultimate') if charge_names.any? { |x| SubscriptionDefinitions.dotcom_ultimate.include?(x) }
|
269
|
+
sub_types.push('sub_gitlab_dedicated') if charge_names.any? { |x| SubscriptionDefinitions.gitlab_dedicated.include?(x) }
|
270
|
+
sub_types.push('sub_edu') if charge_names.any? { |x| SubscriptionDefinitions.edu.include?(x) }
|
271
|
+
sub_types.push('sub_oss') if charge_names.any? { |x| SubscriptionDefinitions.oss.include?(x) }
|
272
|
+
sub_types.push('sub_community_other') if charge_names.any? { |x| SubscriptionDefinitions.community_other.include?(x) }
|
273
|
+
sub_types.push('sub_ss_growth') if charge_names.any? { |x| SubscriptionDefinitions.ss_success_advanced.include?(x) }
|
274
|
+
sub_types.push('sub_ss_enterprise') if charge_names.any? { |x| SubscriptionDefinitions.ss_success_signature.include?(x) }
|
275
|
+
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '00161000010fYlBAAU' && charge_names.select { |x| x =~ /Success\ Plan\ Services/ }
|
276
|
+
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '001PL00000S7nT3YAJ' && charge_names.select { |x| x =~ /Success\ Plan\ Services/ }
|
277
|
+
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '0016100000K8R8fAAF' && charge_names.select { |x| x =~ /Success\ Plan\ Services/ }
|
278
|
+
sub_types.push('sub_ss_enterprise') if account.Account_ID_18__c == '0014M00001lcEpNQAU' && charge_names.select { |x| x =~ /Success\ Plan\ Services/ }
|
279
|
+
if account.Support_Instance__c != 'federal-support'
|
280
|
+
has_12x5 = charge_names.any? { |x| SubscriptionDefinitions.usgov_12x5.include?(x) }
|
281
|
+
has_24x7 = charge_names.any? { |x| SubscriptionDefinitions.usgov_24x7.include?(x) }
|
282
|
+
unless has_12x5 || has_24x7
|
283
|
+
sub_types.push('sub_sm_premium') if charge_names.any? { |x| SubscriptionDefinitions.sm_premium.include?(x) }
|
284
|
+
sub_types.push('sub_sm_ultimate') if charge_names.any? { |x| SubscriptionDefinitions.sm_ultimate.include?(x) }
|
285
|
+
sub_types.push('sub_consumption_duo_premium') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_premium.include?(x) }
|
286
|
+
sub_types.push('sub_consumption_duo_enterprise') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_enterprise.include?(x) }
|
287
|
+
sub_types.push('sub_consumption_duo_amazon_q') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_amazon_q.include?(x) }
|
288
|
+
sub_types.push('sub_ss_ase') if charge_names.any? { |x| SubscriptionDefinitions.ss_ase.include?(x) }
|
289
|
+
sub_types.push('sub_consumption_eap') if charge_names.any? { |x| SubscriptionDefinitions.consumption_eap.include?(x) }
|
290
|
+
end
|
291
|
+
end
|
292
|
+
sub_types
|
293
|
+
end
|
294
|
+
|
295
|
+
def self.process_usgov_subs(account, charge_names)
|
296
|
+
sub_types = []
|
297
|
+
sub_types.push('sub_usgov_12x5') if charge_names.any? { |x| SubscriptionDefinitions.usgov_12x5.include?(x) }
|
298
|
+
sub_types.push('sub_usgov_24x7') if charge_names.any? { |x| SubscriptionDefinitions.usgov_24x7.include?(x) }
|
299
|
+
sub_types.push('sub_usgov_24x7') if charge_names.any? { |x| SubscriptionDefinitions.fedramp.include?(x) }
|
300
|
+
sub_types.push('sub_gitlab_dedicated') if charge_names.any? { |x| SubscriptionDefinitions.fedramp.include?(x) }
|
301
|
+
if account.Support_Instance__c == 'federal-support'
|
302
|
+
sub_types.push('sub_sm_premium') if charge_names.any? { |x| SubscriptionDefinitions.sm_premium.include?(x) }
|
303
|
+
sub_types.push('sub_sm_ultimate') if charge_names.any? { |x| SubscriptionDefinitions.sm_ultimate.include?(x) }
|
304
|
+
sub_types.push('sub_consumption_duo_premium') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_premium.include?(x) }
|
305
|
+
sub_types.push('sub_consumption_duo_enterprise') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_enterprise.include?(x) }
|
306
|
+
sub_types.push('sub_consumption_duo_amazon_q') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_amazon_q.include?(x) }
|
307
|
+
sub_types.push('sub_ss_ase') if charge_names.any? { |x| SubscriptionDefinitions.ss_ase.include?(x) }
|
308
|
+
sub_types.push('sub_consumption_eap') if charge_names.any? { |x| SubscriptionDefinitions.consumption_eap.include?(x) }
|
309
|
+
end
|
310
|
+
has_12x5 = charge_names.any? { |x| SubscriptionDefinitions.usgov_12x5.include?(x) }
|
311
|
+
has_24x7 = charge_names.any? { |x| SubscriptionDefinitions.usgov_24x7.include?(x) }
|
312
|
+
if has_12x5 || has_24x7
|
313
|
+
sub_types.push('sub_sm_premium') if charge_names.any? { |x| SubscriptionDefinitions.sm_premium.include?(x) }
|
314
|
+
sub_types.push('sub_sm_ultimate') if charge_names.any? { |x| SubscriptionDefinitions.sm_ultimate.include?(x) }
|
315
|
+
sub_types.push('sub_consumption_duo_premium') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_premium.include?(x) }
|
316
|
+
sub_types.push('sub_consumption_duo_enterprise') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_enterprise.include?(x) }
|
317
|
+
sub_types.push('sub_consumption_duo_amazon_q') if charge_names.any? { |x| SubscriptionDefinitions.consumption_duo_amazon_q.include?(x) }
|
318
|
+
sub_types.push('sub_ss_ase') if charge_names.any? { |x| SubscriptionDefinitions.ss_ase.include?(x) }
|
319
|
+
sub_types.push('sub_consumption_eap') if charge_names.any? { |x| SubscriptionDefinitions.consumption_eap.include?(x) }
|
320
|
+
end
|
321
|
+
sub_types
|
322
|
+
end
|
323
|
+
|
282
324
|
##
|
283
325
|
# Returns an accounts latest expiration
|
284
326
|
#
|
@@ -473,7 +515,7 @@ module Readiness
|
|
473
515
|
next if valid_charges.map { |a| a.Name }.any? { |x| SubscriptionDefinitions.fedramp.include?(x) }
|
474
516
|
next if valid_charges.map { |a| a.Name }.any? { |x| SubscriptionDefinitions.sm_ultimate.include?(x) } && account.Support_Instance__c == 'federal-support'
|
475
517
|
next if valid_charges.map { |a| a.Name }.any? { |x| SubscriptionDefinitions.sm_premium.include?(x) } && account.Support_Instance__c == 'federal-support'
|
476
|
-
next if valid_charges.map { |a| a.Name }.any? { |x| SubscriptionDefinitions.sm_starter.include?(x) } && account.Support_Instance__c == 'federal-support'
|
518
|
+
next if valid_charges.map { |a| a.Name }.any? { |x| SubscriptionDefinitions.sm_starter.include?(x) } && account.Support_Instance__c == 'federal-support'
|
477
519
|
|
478
520
|
global_subs_present = true
|
479
521
|
end
|
@@ -510,7 +552,11 @@ module Readiness
|
|
510
552
|
'24x7 US Citizen Support - 1 Year',
|
511
553
|
'24x7 US Citizen Support - 2 Year',
|
512
554
|
'24x7 US Citizen Support - 3 Year',
|
513
|
-
'24x7 US Citizen Support - Monthly'
|
555
|
+
'24x7 US Citizen Support - Monthly',
|
556
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 1 Year',
|
557
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 2 Year',
|
558
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 3 Year',
|
559
|
+
'GitLab Dedicated for US Public Sector - Ultimate - Monthly'
|
514
560
|
) OR
|
515
561
|
Zuora__Account__r.Support_Instance__c = 'federal-support'
|
516
562
|
)
|
@@ -602,6 +648,7 @@ module Readiness
|
|
602
648
|
Restricted_Account__c,
|
603
649
|
Solutions_Architect_Lookup__r.Name,
|
604
650
|
Support_Hold__c,
|
651
|
+
Support_Instance__c,
|
605
652
|
(
|
606
653
|
SELECT
|
607
654
|
Id,
|
@@ -633,7 +680,11 @@ module Readiness
|
|
633
680
|
'24x7 US Citizen Support - 1 Year',
|
634
681
|
'24x7 US Citizen Support - 2 Year',
|
635
682
|
'24x7 US Citizen Support - 3 Year',
|
636
|
-
'24x7 US Citizen Support - Monthly'
|
683
|
+
'24x7 US Citizen Support - Monthly',
|
684
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 1 Year',
|
685
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 2 Year',
|
686
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 3 Year',
|
687
|
+
'GitLab Dedicated for US Public Sector - Ultimate - Monthly'
|
637
688
|
) OR
|
638
689
|
Zuora__Account__r.Support_Instance__c = 'federal-support'
|
639
690
|
)
|
@@ -91,7 +91,11 @@ module Readiness
|
|
91
91
|
'24x7 US Citizen Support - 1 Year',
|
92
92
|
'24x7 US Citizen Support - 2 Year',
|
93
93
|
'24x7 US Citizen Support - 3 Year',
|
94
|
-
'24x7 US Citizen Support - Monthly'
|
94
|
+
'24x7 US Citizen Support - Monthly',
|
95
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 1 Year',
|
96
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 2 Year',
|
97
|
+
'GitLab Dedicated for US Public Sector - Ultimate - 3 Year',
|
98
|
+
'GitLab Dedicated for US Public Sector - Ultimate - Monthly'
|
95
99
|
) OR
|
96
100
|
Zuora__Account__r.Support_Instance__c = 'federal-support'
|
97
101
|
)
|
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.143
|
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-
|
11
|
+
date: 2025-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|