gitlab_support_readiness 1.0.41 → 1.0.42
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/mailgun/client.rb +2 -1
- data/lib/support_readiness/mailgun/emails.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/create_article.rb +375 -0
- data/lib/support_readiness/support_super_form_processor/create_macro.rb +183 -0
- data/lib/support_readiness/support_super_form_processor/edit_macro.rb +161 -0
- data/lib/support_readiness/support_super_form_processor/enable_us_government.rb +236 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_billing_entity_change.rb +218 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_extension.rb +238 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_investigate.rb +238 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_link.rb +213 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_nfr.rb +224 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_reset_seat_qsr.rb +194 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_edit.rb +198 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_extension.rb +228 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_over_plan.rb +219 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_hackerone_license.rb +172 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_oem_license.rb +241 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_order_management.rb +267 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_other.rb +137 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb +179 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_did_not_receive.rb +191 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_multiyear.rb +188 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_nfr.rb +215 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_resend.rb +188 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_scl.rb +194 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_temp.rb +234 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_edit.rb +203 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_extension.rb +233 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_new.rb +223 -0
- data/lib/support_readiness/support_super_form_processor/global_ir_wider_community_license.rb +247 -0
- data/lib/support_readiness/support_super_form_processor/global_set_collaboration_id.rb +151 -0
- data/lib/support_readiness/support_super_form_processor/global_set_org_ase.rb +293 -0
- data/lib/support_readiness/support_super_form_processor/global_toggle_escalation.rb +142 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_extension.rb +247 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_former_customer.rb +288 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_migration.rb +238 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_other.rb +221 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_prospect.rb +288 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_upgrade.rb +298 -0
- data/lib/support_readiness/support_super_form_processor/namespace_availability.rb +213 -0
- data/lib/support_readiness/support_super_form_processor/pd_shadow_modification.rb +189 -0
- data/lib/support_readiness/support_super_form_processor/sa_request_for_support.rb +214 -0
- data/lib/support_readiness/support_super_form_processor/shared.rb +518 -0
- data/lib/support_readiness/support_super_form_processor/team_member_license.rb +144 -0
- data/lib/support_readiness/support_super_form_processor/two_fa_exemption.rb +260 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb +252 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_other.rb +136 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_did_not_receive.rb +162 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_multiyear.rb +159 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_nfr.rb +196 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_resend.rb +159 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_scl.rb +160 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_temp.rb +219 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_edit.rb +189 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_extension.rb +219 -0
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_new.rb +209 -0
- data/lib/support_readiness/support_super_form_processor/usgov_set_collaboration_id.rb +151 -0
- data/lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb +295 -0
- data/lib/support_readiness/support_super_form_processor.rb +67 -0
- data/lib/support_readiness.rb +1 -0
- metadata +59 -2
@@ -0,0 +1,160 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module SupportSuperFormProcessor
|
6
|
+
module SupportSuperFormProcessor
|
7
|
+
##
|
8
|
+
# Defines the class USGovIRSMSubscriptionsSCL within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.42
|
12
|
+
class USGovIRSMSubscriptionsSCL < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a US Government Internal Request Self-Managed Subscriptions Strict Cloud Licensing request
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.42
|
18
|
+
def self.process!(gitlab_client, gitlab_admin_client, zendesk_client)
|
19
|
+
@gitlab_client = gitlab_client
|
20
|
+
@gitlab_admin_client = gitlab_admin_client
|
21
|
+
@zendesk_client = zendesk_client
|
22
|
+
requester
|
23
|
+
zd_user
|
24
|
+
ticket = Readiness::Zendesk::Tickets.new
|
25
|
+
ticket.requester_id = zd_user.id
|
26
|
+
ticket.submitter_id = zd_user.id
|
27
|
+
ticket.comment = { html_body: body }
|
28
|
+
ticket.subject = 'Internal Request - SM - Cloud Licensing exemption'
|
29
|
+
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_license lnr_sm_license_scl]
|
30
|
+
ticket.priority = 'normal'
|
31
|
+
ticket.status = 'new'
|
32
|
+
ticket.ticket_form_id = 360001803151
|
33
|
+
ticket.custom_fields = [
|
34
|
+
{ id: 11717320292244, value: 'ir_scl_exemption' },
|
35
|
+
{ id: 11717222771604, value: zd_user.email }
|
36
|
+
]
|
37
|
+
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
+
puts "Ticket created: https://gitlab-federal-support.zendesk.com/agent/tickets/#{create.id}"
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Sets the global variable requester
|
43
|
+
#
|
44
|
+
# @author Jason Colyer
|
45
|
+
# @since 1.0.42
|
46
|
+
def self.requester
|
47
|
+
@requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Sets the global variable zd_user
|
52
|
+
#
|
53
|
+
# @author Jason Colyer
|
54
|
+
# @since 1.0.42
|
55
|
+
def self.zd_user
|
56
|
+
@zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Sets the global variable requester_email
|
61
|
+
#
|
62
|
+
# @author Jason Colyer
|
63
|
+
# @since 1.0.42
|
64
|
+
def self.requester_email
|
65
|
+
@requester_email ||= ENV.fetch('REQUESTER_EMAIL')
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Sets the global variable context
|
70
|
+
#
|
71
|
+
# @author Jason Colyer
|
72
|
+
# @since 1.0.42
|
73
|
+
def self.context
|
74
|
+
@context ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTEXT')
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Sets the global variable contact_name
|
79
|
+
#
|
80
|
+
# @author Jason Colyer
|
81
|
+
# @since 1.0.42
|
82
|
+
def self.contact_name
|
83
|
+
@contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Sets the global variable contact_email
|
88
|
+
#
|
89
|
+
# @author Jason Colyer
|
90
|
+
# @since 1.0.42
|
91
|
+
def self.contact_email
|
92
|
+
@contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Sets the global variable chattr_link
|
97
|
+
#
|
98
|
+
# @author Jason Colyer
|
99
|
+
# @since 1.0.42
|
100
|
+
def self.chattr_link
|
101
|
+
@chattr_link ||= ENV.fetch('USFED_SM_SCL_SFDC_CHATTER')
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Sets the global variable sfdc_account
|
106
|
+
#
|
107
|
+
# @author Jason Colyer
|
108
|
+
# @since 1.0.42
|
109
|
+
def self.sfdc_account
|
110
|
+
@sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Sets the global variable version
|
115
|
+
#
|
116
|
+
# @author Jason Colyer
|
117
|
+
# @since 1.0.42
|
118
|
+
def self.version
|
119
|
+
@version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Returns the ticket body
|
124
|
+
#
|
125
|
+
# @author Jason Colyer
|
126
|
+
# @since 1.0.42
|
127
|
+
# @return [String]
|
128
|
+
def self.body
|
129
|
+
<<~STRING
|
130
|
+
<p>
|
131
|
+
Greetings,
|
132
|
+
</p>
|
133
|
+
<p>
|
134
|
+
Please note that this is an <b>INTERNAL</b> ticket and should <b>NEVER</b> be shared with anyone. Please do not CC, BCC, forward, or anything else that can send the information from this ticket. <b>NEVER</b> add <i>anyone</i> outside of GitLab to this ticket or communications stemming from this ticket.
|
135
|
+
</p>
|
136
|
+
<p>
|
137
|
+
A request has been filed for Cloud Licensing exemption.
|
138
|
+
</p>
|
139
|
+
<p>
|
140
|
+
The information for this is as follows:
|
141
|
+
</p>
|
142
|
+
<ul>
|
143
|
+
<li>Contact's name: #{contact_name}</li>
|
144
|
+
<li>Contact's email: #{contact_email}</li>
|
145
|
+
<li>GitLab Version: #{version}</li>
|
146
|
+
<li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_chattr_string(chattr_link)}</li>
|
147
|
+
<li>GitLab Version: #{version}</li>
|
148
|
+
<li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
|
149
|
+
</ul>
|
150
|
+
<p>
|
151
|
+
Some additional context for this request is:
|
152
|
+
</p>
|
153
|
+
<pre>
|
154
|
+
#{context}
|
155
|
+
</pre>
|
156
|
+
STRING
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module SupportSuperFormProcessor
|
6
|
+
module SupportSuperFormProcessor
|
7
|
+
##
|
8
|
+
# Defines the class USGovIRSMSubscriptionsTemp within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.42
|
12
|
+
class USGovIRSMSubscriptionsTemp < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a US Government Internal Request Self-Managed Subscriptions Temp request
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.42
|
18
|
+
def self.process!(gitlab_client, gitlab_admin_client, zendesk_client)
|
19
|
+
@gitlab_client = gitlab_client
|
20
|
+
@gitlab_admin_client = gitlab_admin_client
|
21
|
+
@zendesk_client = zendesk_client
|
22
|
+
requester
|
23
|
+
zd_user
|
24
|
+
ticket = Readiness::Zendesk::Tickets.new
|
25
|
+
ticket.requester_id = zd_user.id
|
26
|
+
ticket.submitter_id = zd_user.id
|
27
|
+
ticket.comment = { html_body: body }
|
28
|
+
ticket.subject = 'Internal Request - SM - Extend an (almost) expired subscription'
|
29
|
+
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_license lnr_sm_license_extension]
|
30
|
+
ticket.priority = 'normal'
|
31
|
+
ticket.status = 'new'
|
32
|
+
ticket.ticket_form_id = 360001803151
|
33
|
+
ticket.custom_fields = [
|
34
|
+
{ id: 11717320292244, value: 'ir_sm_temp' },
|
35
|
+
{ id: 11717222771604, value: zd_user.email }
|
36
|
+
]
|
37
|
+
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
+
puts "Ticket created: https://gitlab-federal-support.zendesk.com/agent/tickets/#{create.id}"
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Sets the global variable requester
|
43
|
+
#
|
44
|
+
# @author Jason Colyer
|
45
|
+
# @since 1.0.42
|
46
|
+
def self.requester
|
47
|
+
@requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Sets the global variable zd_user
|
52
|
+
#
|
53
|
+
# @author Jason Colyer
|
54
|
+
# @since 1.0.42
|
55
|
+
def self.zd_user
|
56
|
+
@zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Sets the global variable requester_email
|
61
|
+
#
|
62
|
+
# @author Jason Colyer
|
63
|
+
# @since 1.0.42
|
64
|
+
def self.requester_email
|
65
|
+
@requester_email ||= ENV.fetch('REQUESTER_EMAIL')
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Sets the global variable context
|
70
|
+
#
|
71
|
+
# @author Jason Colyer
|
72
|
+
# @since 1.0.42
|
73
|
+
def self.context
|
74
|
+
@context ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTEXT')
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Sets the global variable contact_name
|
79
|
+
#
|
80
|
+
# @author Jason Colyer
|
81
|
+
# @since 1.0.42
|
82
|
+
def self.contact_name
|
83
|
+
@contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Sets the global variable contact_email
|
88
|
+
#
|
89
|
+
# @author Jason Colyer
|
90
|
+
# @since 1.0.42
|
91
|
+
def self.contact_email
|
92
|
+
@contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Sets the global variable company
|
97
|
+
#
|
98
|
+
# @author Jason Colyer
|
99
|
+
# @since 1.0.42
|
100
|
+
def self.company
|
101
|
+
@company ||= ENV.fetch('INTERNAL_REQUEST_USFED_COMPANY_NAME')
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Sets the global variable opp_link
|
106
|
+
#
|
107
|
+
# @author Jason Colyer
|
108
|
+
# @since 1.0.42
|
109
|
+
def self.opp_link
|
110
|
+
@opp_link ||= ENV.fetch('USFED_SM_LICENSE_TEMP_OPP_LINK')
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Sets the global variable current
|
115
|
+
#
|
116
|
+
# @author Jason Colyer
|
117
|
+
# @since 1.0.42
|
118
|
+
def self.current
|
119
|
+
@current ||= ENV.fetch('USFED_SM_LICENSE_SEATS')
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Sets the global variable trueup
|
124
|
+
#
|
125
|
+
# @author Jason Colyer
|
126
|
+
# @since 1.0.42
|
127
|
+
def self.trueup
|
128
|
+
@trueup ||= ENV.fetch('USFED_SM_LICENSE_TRUEUPS')
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Sets the global variable plan
|
133
|
+
#
|
134
|
+
# @author Jason Colyer
|
135
|
+
# @since 1.0.42
|
136
|
+
def self.plan
|
137
|
+
@plan ||= ENV.fetch('USFED_SM_LICENSE_PLAN')
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Sets the global variable extension_date
|
142
|
+
#
|
143
|
+
# @author Jason Colyer
|
144
|
+
# @since 1.0.42
|
145
|
+
def self.extension_date
|
146
|
+
@extension_date ||= ENV.fetch('USFED_SM_LICENSE_EXPIRATION')
|
147
|
+
end
|
148
|
+
|
149
|
+
##
|
150
|
+
# Sets the global variable reason
|
151
|
+
#
|
152
|
+
# @author Jason Colyer
|
153
|
+
# @since 1.0.42
|
154
|
+
def self.reason
|
155
|
+
@reason ||= ENV.fetch('USFED_SM_LICENSE_REASON')
|
156
|
+
end
|
157
|
+
|
158
|
+
##
|
159
|
+
# Sets the global variable sfdc_account
|
160
|
+
#
|
161
|
+
# @author Jason Colyer
|
162
|
+
# @since 1.0.42
|
163
|
+
def self.sfdc_account
|
164
|
+
@sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
|
165
|
+
end
|
166
|
+
|
167
|
+
##
|
168
|
+
# Sets the global variable version
|
169
|
+
#
|
170
|
+
# @author Jason Colyer
|
171
|
+
# @since 1.0.42
|
172
|
+
def self.version
|
173
|
+
@version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Returns the ticket body
|
178
|
+
#
|
179
|
+
# @author Jason Colyer
|
180
|
+
# @since 1.0.42
|
181
|
+
# @return [String]
|
182
|
+
def self.body
|
183
|
+
<<~STRING
|
184
|
+
<p>
|
185
|
+
Greetings,
|
186
|
+
</p>
|
187
|
+
<p>
|
188
|
+
Please note that this is an <b>INTERNAL</b> ticket and should <b>NEVER</b> be shared with anyone. Please do not CC, BCC, forward, or anything else that can send the information from this ticket. <b>NEVER</b> add <i>anyone</i> outside of GitLab to this ticket or communications stemming from this ticket.
|
189
|
+
</p>
|
190
|
+
<p>
|
191
|
+
A request has been filed for Extend an (almost) expired subscription (SM).
|
192
|
+
</p>
|
193
|
+
<p>
|
194
|
+
The information for this is as follows:
|
195
|
+
</p>
|
196
|
+
<ul>
|
197
|
+
<li>Contact's name: #{contact_name}</li>
|
198
|
+
<li>Contact's email: #{contact_email}</li>
|
199
|
+
<li>Contact's company: #{company}</li>
|
200
|
+
<li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(opp_link)}</li>
|
201
|
+
<li>Desired expiration date: #{extension_date}</li>
|
202
|
+
<li>Seats needed in temp license: #{current}</li>
|
203
|
+
<li>True-ups needed in temp license: #{trueup}</li>
|
204
|
+
<li>Plan for temp license: #{plan}</li>
|
205
|
+
<li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
|
206
|
+
<li>Reason for extension: #{reason}</li>
|
207
|
+
<li>GitLab Version: #{version}</li>
|
208
|
+
</ul>
|
209
|
+
<p>
|
210
|
+
Some additional context for this request is:
|
211
|
+
</p>
|
212
|
+
<pre>
|
213
|
+
#{context}
|
214
|
+
</pre>
|
215
|
+
STRING
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,189 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module SupportSuperFormProcessor
|
6
|
+
module SupportSuperFormProcessor
|
7
|
+
##
|
8
|
+
# Defines the class USGovIRSMTrialsEdit within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.42
|
12
|
+
class USGovIRSMTrialsEdit < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a US Government Internal Request Self-Managed Trials Edit request
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.42
|
18
|
+
def self.process!(gitlab_client, gitlab_admin_client, zendesk_client)
|
19
|
+
@gitlab_client = gitlab_client
|
20
|
+
@gitlab_admin_client = gitlab_admin_client
|
21
|
+
@zendesk_client = zendesk_client
|
22
|
+
requester
|
23
|
+
zd_user
|
24
|
+
ticket = Readiness::Zendesk::Tickets.new
|
25
|
+
ticket.requester_id = zd_user.id
|
26
|
+
ticket.submitter_id = zd_user.id
|
27
|
+
ticket.comment = { html_body: body }
|
28
|
+
ticket.subject = 'Internal Request - SM - Modify an existing trial'
|
29
|
+
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_edit]
|
30
|
+
ticket.priority = 'normal'
|
31
|
+
ticket.status = 'new'
|
32
|
+
ticket.ticket_form_id = 360001803151
|
33
|
+
ticket.custom_fields = [
|
34
|
+
{ id: 11717320292244, value: 'ir_modify_sm_trial' },
|
35
|
+
{ id: 11717222771604, value: zd_user.email }
|
36
|
+
]
|
37
|
+
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
+
puts "Ticket created: https://gitlab-federal-support.zendesk.com/agent/tickets/#{create.id}"
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Sets the global variable requester
|
43
|
+
#
|
44
|
+
# @author Jason Colyer
|
45
|
+
# @since 1.0.42
|
46
|
+
def self.requester
|
47
|
+
@requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# Sets the global variable zd_user
|
52
|
+
#
|
53
|
+
# @author Jason Colyer
|
54
|
+
# @since 1.0.42
|
55
|
+
def self.zd_user
|
56
|
+
@zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
|
57
|
+
end
|
58
|
+
|
59
|
+
##
|
60
|
+
# Sets the global variable requester_email
|
61
|
+
#
|
62
|
+
# @author Jason Colyer
|
63
|
+
# @since 1.0.42
|
64
|
+
def self.requester_email
|
65
|
+
@requester_email ||= ENV.fetch('REQUESTER_EMAIL')
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Sets the global variable context
|
70
|
+
#
|
71
|
+
# @author Jason Colyer
|
72
|
+
# @since 1.0.42
|
73
|
+
def self.context
|
74
|
+
@context ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTEXT')
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Sets the global variable contact_name
|
79
|
+
#
|
80
|
+
# @author Jason Colyer
|
81
|
+
# @since 1.0.42
|
82
|
+
def self.contact_name
|
83
|
+
@contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Sets the global variable contact_email
|
88
|
+
#
|
89
|
+
# @author Jason Colyer
|
90
|
+
# @since 1.0.42
|
91
|
+
def self.contact_email
|
92
|
+
@contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Sets the global variable company
|
97
|
+
#
|
98
|
+
# @author Jason Colyer
|
99
|
+
# @since 1.0.42
|
100
|
+
def self.company
|
101
|
+
@company ||= ENV.fetch('INTERNAL_REQUEST_USFED_COMPANY_NAME')
|
102
|
+
end
|
103
|
+
|
104
|
+
##
|
105
|
+
# Sets the global variable license_link
|
106
|
+
#
|
107
|
+
# @author Jason Colyer
|
108
|
+
# @since 1.0.42
|
109
|
+
def self.license_link
|
110
|
+
@license_link ||= ENV.fetch('USFED_SM_TRIAL_EDIT_LICENSE')
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Sets the global variable current
|
115
|
+
#
|
116
|
+
# @author Jason Colyer
|
117
|
+
# @since 1.0.42
|
118
|
+
def self.current
|
119
|
+
@current ||= ENV.fetch('USFED_SM_TRIAL_EDIT_USERS')
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Sets the global variable plan
|
124
|
+
#
|
125
|
+
# @author Jason Colyer
|
126
|
+
# @since 1.0.42
|
127
|
+
def self.plan
|
128
|
+
@plan ||= ENV.fetch('USFED_SM_TRIAL_EDIT_PLAN')
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Sets the global variable sfdc_account
|
133
|
+
#
|
134
|
+
# @author Jason Colyer
|
135
|
+
# @since 1.0.42
|
136
|
+
def self.sfdc_account
|
137
|
+
@sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Sets the global variable version
|
142
|
+
#
|
143
|
+
# @author Jason Colyer
|
144
|
+
# @since 1.0.42
|
145
|
+
def self.version
|
146
|
+
@version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
|
147
|
+
end
|
148
|
+
|
149
|
+
##
|
150
|
+
# Returns the ticket body
|
151
|
+
#
|
152
|
+
# @author Jason Colyer
|
153
|
+
# @since 1.0.42
|
154
|
+
# @return [String]
|
155
|
+
def self.body
|
156
|
+
<<~STRING
|
157
|
+
<p>
|
158
|
+
Greetings
|
159
|
+
</p>
|
160
|
+
<p>
|
161
|
+
A request has been filed for Modify an existing Self-managed trial.
|
162
|
+
</p>
|
163
|
+
<p>
|
164
|
+
Please note that this is an <b>INTERNAL</b> ticket and should <b>NEVER</b> be shared with anyone. Please do not CC, BCC, forward, or anything else that can send the information from this ticket. <b>NEVER</b> add <i>anyone</i> outside of GitLab to this ticket or communications stemming from this ticket.
|
165
|
+
</p>
|
166
|
+
<p>
|
167
|
+
The information for this is as follows:
|
168
|
+
</p>
|
169
|
+
<ul>
|
170
|
+
<li>Contact's name: #{contact_name}</li>
|
171
|
+
<li>Contact's email: #{contact_email}</li>
|
172
|
+
<li>Company: #{company}</li>
|
173
|
+
<li>License link: #{license_link}</li>
|
174
|
+
<li>User count: #{current}</li>
|
175
|
+
<li>Plan: #{plan}</li>
|
176
|
+
<li>GitLab Version: #{version}</li>
|
177
|
+
<li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
|
178
|
+
</ul>
|
179
|
+
<p>
|
180
|
+
Some additional context for this request is:
|
181
|
+
</p>
|
182
|
+
<pre>
|
183
|
+
#{context}
|
184
|
+
</pre>
|
185
|
+
STRING
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|