gitlab_support_readiness 1.0.129 → 1.0.130

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: e7b7c44f86de47cccbb84c351a3de19851fa2c7a295fd5d0e66fac26578ff188
4
- data.tar.gz: f77bd8a3426eab42e00d07e6fe2c3f82ad0604f9fa0aff101b8a2120dcc43968
3
+ metadata.gz: 0102aacc88b5b814217895ec69e839a573c84055d0b786e1116a053895989a92
4
+ data.tar.gz: 40d8aa364040549bce14ee3bcd3e5c61889fd68ade93e5fc5ceda6fb73cf1fed
5
5
  SHA512:
6
- metadata.gz: 561b7428e26b9b098c8788cb18834efa9eab307427bec2c81bdb3d2796c7e2bb279dcec17b7514bd0044fe50e95468cfe6b6e73f66fc6660553dc6557b9a706c
7
- data.tar.gz: 58c1d9d584321a9b3d0eb3371929311552c024adce67e3a44f8de026a3f908c5b072eca0a92399b8e3d92c58d4931dbc69545a4597321b8ef1552a08b7e27a8b
6
+ metadata.gz: af924cefa67d6300b81fb1d8052f4db5e084d25dbe86cd1e8e953654b25d483bb6ae2e8eddb5cc59a750d3df82d55647f5c9de831fbe6eab4eb064d7110706e3
7
+ data.tar.gz: 0af864729707ae8d02168ae4a6a2c50ce8f311eb997f3068d624b7e56e22d5148147067bd5e940b71a24f66579c0b1e1f8eb6dcc122ea1a784dcb44a976fe0af
@@ -90,7 +90,7 @@ module Readiness
90
90
  def self.global_accounts(client)
91
91
  query = Queries.new(global_sync_query_string)
92
92
  results = Queries.run!(client, query)
93
- results.map { |r| global_sync_object(r) }
93
+ results.map { |r| global_sync_object(r) }.compact
94
94
  end
95
95
 
96
96
  ##
@@ -125,6 +125,8 @@ module Readiness
125
125
  # @since 1.0.26
126
126
  def self.global_sync_object(account)
127
127
  subscriptions = account_subscriptions(account)
128
+ return nil if us_gov_only?(account, subscriptions)
129
+
128
130
  expiration = account_expiration(account)
129
131
  type = account_type(account, expiration)
130
132
  partner = %w[alliance_partner open_partner select_partner].include?(type)
@@ -442,6 +444,38 @@ module Readiness
442
444
  }
443
445
  end
444
446
 
447
+ ##
448
+ # Determines if a given account with its subscriptions is US Government only
449
+ #
450
+ # @author Jason Colyer
451
+ # @since 1.0.130
452
+ def self.us_gov_only?(account, subs)
453
+ return false if subs.count.zero?
454
+ return false if subs.include? 'sub_consumption_cicd_minutes'
455
+ return false if subs.include? 'sub_dotcom_premium'
456
+ return false if subs.include? 'sub_dotcom_ultimate'
457
+ return false if subs.include? 'sub_edu'
458
+ return false if subs.include? 'sub_oss'
459
+ return false if subs.include? 'sub_community_other'
460
+
461
+ if subs.include?('sub_usgov_12x5') || subs.include?('sub_usgov_24x7') || account.Support_Instance__c == 'federal-support'
462
+ global_subs_present = false
463
+ grouped = account.Zuora__R00N40000001lGjTEAU__r.group_by { |z| z.Zuora__ProductName__c }
464
+ grouped.each_value do |charges|
465
+ next if charges.detect { |c| SubscriptionDefinitions.usgov_12x5.include? c.Name }
466
+ next if charges.detect { |c| SubscriptionDefinitions.usgov_24x7.include? c.Name }
467
+ next if charges.detect { |c| SubscriptionDefinitions.fedramp.include? c.Name }
468
+ next if charges.detect { |c| SubscriptionDefinitions.sm_ultimate.include? c.Name } && account.Support_Instance__c == 'federal-support'
469
+ next if charges.detect { |c| SubscriptionDefinitions.sm_premium.include? c.Name } && account.Support_Instance__c == 'federal-support'
470
+ next if charges.detect { |c| SubscriptionDefinitions.sm_starter.include? c.Name } && account.Support_Instance__c == 'federal-support'
471
+
472
+ global_subs_present = true
473
+ end
474
+ return true unless global_subs_present
475
+ end
476
+ false
477
+ end
478
+
445
479
  ##
446
480
  # Provides the String needed to make a specific type of SOQL query
447
481
  #
@@ -502,6 +536,7 @@ module Readiness
502
536
  Partners_Partner_Type__c,
503
537
  Support_Hold__c,
504
538
  Account_Risk_Level__c,
539
+ Support_Instance__c,
505
540
  (
506
541
  SELECT
507
542
  Id,
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.129
4
+ version: 1.0.130
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-03-03 00:00:00.000000000 Z
11
+ date: 2025-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport