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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06cdfb404230f5d597a2ec654c113514737824c05c4d07076e13920514f6ee50
4
- data.tar.gz: 8ce3ef6d3d4409339365f6e5eea40b13c0e92bd956ece9817abbd915286c655c
3
+ metadata.gz: acdd50bfdfe882c975ccd807c9215a3b3e598e15427a05046a0775940b5a7246
4
+ data.tar.gz: f1b20ae89321a207ff4d53c00f1207344236e610eecfd30a65498ea714e672d1
5
5
  SHA512:
6
- metadata.gz: 46dbfd8867ba9a3cb19a0909a63973931a8050da8a3fdfb5fc83872385ce2c022cb742caa4c7c27740ecbe1c026529e01991c8d2bc89a6ef91cc592047b3b2a0
7
- data.tar.gz: 9f74fe0c15e67021261ec6941499b8f8a5f8c6da730fa150910442ce8c3a01a081aad08e0c580090353c5548795ac089fc8bab19104fe64af47ab198a71cfffb
6
+ metadata.gz: 2035dd020578666e40deb9cbfb0296f63599dcd3bd5187ccc8a8a72b9c73fbaa4649e9b9de31166393749bab2441fa2b4dd6980363892c612dad3ed2d99ce7b5
7
+ data.tar.gz: 56b89359923d019df2f2383fe4629105311d5ee9c9030827cc61f89dad20502ef1897a9e7fc03ac93b03c935e33122a25a3ba8d482bf56eac2182c3be5229f82
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (14.0.2)
4
+ gitlab-qa (14.1.0)
5
5
  activesupport (>= 6.1, < 7.2)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '14.0.2'
5
+ VERSION = '14.1.0'
6
6
  end
7
7
  end
@@ -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
- activation_result = ::GitlabSubscriptions::ActivateService.new.execute(ENV.fetch('QA_EE_ACTIVATION_CODE', nil))
25
+ result = ::GitlabSubscriptions::ActivateService.new.execute(ENV.fetch('QA_EE_ACTIVATION_CODE', nil))
24
26
 
25
- if activation_result[:success]
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.2
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-02 00:00:00.000000000 Z
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control