gitlab_support_readiness 1.0.101 → 1.0.102
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: 3cf288d03f8ef2d56f1210665d4ade6850c3f7aefedf06c11da406d7097d5133
|
4
|
+
data.tar.gz: ad2d39f929421bb4f79f6c5aac82484067ff887cad3220fb7da97abbf1157917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 015d7f17610cb38a375ad34b381becda95b25f5a0aea7ed6d89b3c85b6a544f1f5701ed868a2f10ae8fcc9ce3778fbf320f8cc4fd49bfe80194f54acae6efbee
|
7
|
+
data.tar.gz: d2ac80a9b2efc0967bb23086012584f9ccd4e543099a85ce5255319cae4a00e3f3a427667228da0e864a757059e9a4e9e9cce8ffc81cc692848a5b905fed4662
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module TicketProcessor
|
6
|
+
module TicketProcessor
|
7
|
+
##
|
8
|
+
# Defines the class CodeRequestAdvancedSAST within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.102
|
12
|
+
class CodeRequestAdvancedSAST < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a code request for Advanced SAST
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.102
|
18
|
+
def self.process!(zendesk_client, slack_client, ticket_id)
|
19
|
+
@slack_client = slack_client
|
20
|
+
@zendesk_client = zendesk_client
|
21
|
+
ticket = Readiness::Zendesk::Tickets.find!(@zendesk_client, ticket_id)
|
22
|
+
print 'Processing request...'
|
23
|
+
rejection(ticket) if ticket.organization_id.nil?
|
24
|
+
organization = Readiness::Zendesk::Tickets.find!(@zendesk_client, ticket.organization_id)
|
25
|
+
approval(ticket) if organization.organization_fields['sub_dotcom_ultimate']
|
26
|
+
approval(ticket) if organization.organization_fields['sub_sm_ultimate']
|
27
|
+
approval(ticket) if organization.organization_fields['sub_gitlab_dedicated']
|
28
|
+
approval(ticket) if %w[open_partner select_partner alliance_partner].include? organization.organization_fields['account_type']
|
29
|
+
rejection(ticket)
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
# Update ticket for a rejection
|
34
|
+
#
|
35
|
+
# @author Jason Colyer
|
36
|
+
# @since 1.0.102
|
37
|
+
def self.rejection(ticket)
|
38
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
39
|
+
new_ticket.tags = ticket.tags + ['advanced_sast_code_request_denied']
|
40
|
+
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
41
|
+
puts 'done (rejection)'
|
42
|
+
exit 0
|
43
|
+
end
|
44
|
+
|
45
|
+
##
|
46
|
+
# Update ticket for an approval
|
47
|
+
#
|
48
|
+
# @author Jason Colyer
|
49
|
+
# @since 1.0.102
|
50
|
+
def self.approval(ticket)
|
51
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
52
|
+
new_ticket.tags = ticket.tags + ['advanced_sast_code_request_approved']
|
53
|
+
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
54
|
+
puts 'done (approval)'
|
55
|
+
print 'Posting in Slack...'
|
56
|
+
Readiness::Slack::Messages.create!(@slack_client, legal_slack_message(ticket))
|
57
|
+
puts 'done'
|
58
|
+
exit 0
|
59
|
+
end
|
60
|
+
|
61
|
+
##
|
62
|
+
# Return the message for the Slack post
|
63
|
+
#
|
64
|
+
# @author Jason Colyer
|
65
|
+
# @since 1.0.102
|
66
|
+
def self.legal_slack_message(ticket)
|
67
|
+
<<~STRING
|
68
|
+
Ticket <https://#{domain}/agent/tickets/#{ticket.id}|#{ticket.id}> has requested code information for Advanced SAST. They are being directed to legal@gitlab.com for this request.
|
69
|
+
STRING
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# Return the domain of the zendesk instance being worked with
|
74
|
+
#
|
75
|
+
# @author Jason Colyer
|
76
|
+
# @since 1.0.102
|
77
|
+
def self.domain
|
78
|
+
@zendesk_client.connection.url_prefix.to_s.split('/')[2]
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -8,6 +8,7 @@ module Readiness
|
|
8
8
|
# @since 1.0.44
|
9
9
|
module TicketProcessor
|
10
10
|
require "#{__dir__}/ticket_processor/account_blocked"
|
11
|
+
require "#{__dir__}/ticket_processor/code_request_advanced_sast"
|
11
12
|
require "#{__dir__}/ticket_processor/email_suppressions"
|
12
13
|
require "#{__dir__}/ticket_processor/link_tagger"
|
13
14
|
require "#{__dir__}/ticket_processor/locked_account"
|
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.102
|
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-
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -377,6 +377,7 @@ files:
|
|
377
377
|
- lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb
|
378
378
|
- lib/support_readiness/ticket_processor.rb
|
379
379
|
- lib/support_readiness/ticket_processor/account_blocked.rb
|
380
|
+
- lib/support_readiness/ticket_processor/code_request_advanced_sast.rb
|
380
381
|
- lib/support_readiness/ticket_processor/email_suppressions.rb
|
381
382
|
- lib/support_readiness/ticket_processor/link_tagger.rb
|
382
383
|
- lib/support_readiness/ticket_processor/locked_account.rb
|