gitlab-qa 14.0.2 → 14.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- data/support/setup/code_suggestions_setup.rb +27 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acdd50bfdfe882c975ccd807c9215a3b3e598e15427a05046a0775940b5a7246
|
4
|
+
data.tar.gz: f1b20ae89321a207ff4d53c00f1207344236e610eecfd30a65498ea714e672d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2035dd020578666e40deb9cbfb0296f63599dcd3bd5187ccc8a8a72b9c73fbaa4649e9b9de31166393749bab2441fa2b4dd6980363892c612dad3ed2d99ce7b5
|
7
|
+
data.tar.gz: 56b89359923d019df2f2383fe4629105311d5ee9c9030827cc61f89dad20502ef1897a9e7fc03ac93b03c935e33122a25a3ba8d482bf56eac2182c3be5229f82
|
data/Gemfile.lock
CHANGED
data/lib/gitlab/qa/version.rb
CHANGED
@@ -3,26 +3,28 @@
|
|
3
3
|
class CodeSuggestionsSetup
|
4
4
|
class << self
|
5
5
|
def configure!
|
6
|
-
puts 'Enabling code_suggestions_tokens_api feature flag...'
|
7
|
-
Feature.enable(:code_suggestions_tokens_api)
|
8
|
-
|
9
6
|
activate_cloud_license
|
10
7
|
|
11
8
|
# Due to the various async Sidekiq processes involved, we wait to verify
|
12
9
|
# that the code suggestions access token has been generated before proceeding
|
13
10
|
verify_code_suggestions_access_token
|
14
11
|
|
12
|
+
# TODO: Remove after service start date
|
13
|
+
# This toggle will no longer be used to control access to code suggestions
|
14
|
+
# See https://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/policies/ee/global_policy.rb#L62
|
15
15
|
puts 'Enabling application setting instance_level_code_suggestions_enabled...'
|
16
16
|
ApplicationSetting.last.update(instance_level_code_suggestions_enabled: true)
|
17
|
+
|
18
|
+
assign_code_suggestions_seat_to_admin
|
17
19
|
end
|
18
20
|
|
19
21
|
private
|
20
22
|
|
21
23
|
def activate_cloud_license
|
22
24
|
puts 'Activating cloud license...'
|
23
|
-
|
25
|
+
result = ::GitlabSubscriptions::ActivateService.new.execute(ENV.fetch('QA_EE_ACTIVATION_CODE', nil))
|
24
26
|
|
25
|
-
if
|
27
|
+
if result[:success]
|
26
28
|
puts 'Cloud license activation successful'
|
27
29
|
else
|
28
30
|
puts 'Cloud license activation failed!'
|
@@ -48,6 +50,26 @@ class CodeSuggestionsSetup
|
|
48
50
|
puts "Failed to create code suggestions access token after #{max_attempts} attempts"
|
49
51
|
exit 1
|
50
52
|
end
|
53
|
+
|
54
|
+
def assign_code_suggestions_seat_to_admin
|
55
|
+
puts 'Assigning code suggestions seat to admin...'
|
56
|
+
|
57
|
+
admin = User.find_by(username: 'root')
|
58
|
+
add_on = GitlabSubscriptions::AddOnPurchase.find_by(add_on: GitlabSubscriptions::AddOn.code_suggestions.last)
|
59
|
+
|
60
|
+
result = ::GitlabSubscriptions::UserAddOnAssignments::SelfManaged::CreateService.new(
|
61
|
+
add_on_purchase: add_on, user: admin
|
62
|
+
).execute
|
63
|
+
|
64
|
+
if result.is_a?(ServiceResponse) && result[:status] == :success
|
65
|
+
puts 'Seat assignment for admin successful'
|
66
|
+
else
|
67
|
+
puts 'Seat assignment for admin failed!'
|
68
|
+
|
69
|
+
error = result.is_a?(ServiceResponse) ? result[:message] : result
|
70
|
+
puts error
|
71
|
+
end
|
72
|
+
end
|
51
73
|
end
|
52
74
|
end
|
53
75
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-qa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 14.0
|
4
|
+
version: 14.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|