gitlab-qa 12.5.1 → 13.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/docs/what_tests_can_be_run.md +30 -3
- data/lib/gitlab/qa/component/ai_gateway.rb +26 -0
- data/lib/gitlab/qa/component/gitlab.rb +7 -0
- data/lib/gitlab/qa/runner.rb +1 -1
- data/lib/gitlab/qa/runtime/env.rb +14 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/facebook_oauth.rb +2 -2
- data/lib/gitlab/qa/scenario/test/instance/image.rb +2 -0
- data/lib/gitlab/qa/scenario/test/integration/ai_gateway.rb +90 -0
- data/lib/gitlab/qa/support/gitlab_version_info.rb +1 -2
- data/lib/gitlab/qa/support/http_request.rb +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- data/support/setup/code_suggestions_setup.rb +59 -0
- metadata +5 -3
- data/lib/gitlab/qa/scenario/test/integration/oauth.rb +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16a2d1d19d2421861d4698ef692926f2fa15cc9f4081e39d1ca7e4da46a8ba7c
|
4
|
+
data.tar.gz: 0c65e2931b680e7737df751f702943e40851ac207afcb3be7a01765ec2b47291
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81c553e7373d1fc790429dd8e4e9c1538e7c2a6afc382b7b79170c0edb6b8b83c4f533a60746defc313c846ab92fb4505f84899f3eede1f21bcdcdc586e7b90c
|
7
|
+
data.tar.gz: 492ad5e00e24b345ab1ac724dcf059c9520d992df141a03b413b674262720138a724ed44d633b9d9a926f40471aa44744994b8dcf38eee8753d03728ad3c715e
|
data/Gemfile.lock
CHANGED
@@ -58,7 +58,8 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
|
|
58
58
|
| `GITLAB_QA_ACCESS_TOKEN`|- | A valid personal access token with the `api` scope. This allows tests to use the API without having to create a new personal access token first. It is also used to check what version [deployed environments](https://gitlab.com/gitlab-org/quality/pipeline-common/-/blob/master/ci/dot-com/README.md#projects) are currently running. Existing tokens for each environment can be found in the shared 1Password vault. |No|
|
59
59
|
| `GITLAB_QA_ADMIN_ACCESS_TOKEN` |- | A valid personal access token with the `api` scope from a user with admin access. Used for API access as an admin during tests. | No|
|
60
60
|
| `GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN` | - | A valid personal access token with the `read_registry` scope. Used to [access the container registry on `registry.gitlab.com` when tests run in a CI job that _is not_ triggered via another pipeline](https://gitlab.com/gitlab-org/gitlab-qa/-/blob/364addb83e7b136ff0f9d8719ca9553d290aa9ab/lib/gitlab/qa/release.rb#L152). For example, if you manually run a [new Staging pipeline](https://ops.gitlab.net/gitlab-org/quality/staging/-/pipelines/new), this token will be used. | No |
|
61
|
-
| `EE_LICENSE` |- | Enterprise Edition license. | No|
|
61
|
+
| `EE_LICENSE` |- | Enterprise Edition license. For Staging license to be applied successfully requires `CUSTOMER_PORTAL_URL` set. | No|
|
62
|
+
| `GITLAB_LICENSE_MODE` |- | If set to `test` gitlab-qa will then set customers portal address to Staging address. | No|
|
62
63
|
| `QA_EE_ACTIVATION_CODE` |- | Cloud activation code to enable Enterprise Edition features. | No|
|
63
64
|
| `QA_ARTIFACTS_DIR` |`/tmp/gitlab-qa`| Path to a directory where artifacts (logs and screenshots) for failing tests will be saved. | No|
|
64
65
|
| `DOCKER_HOST` |`http://localhost`| Docker host to run tests against. | No|
|
@@ -120,6 +121,8 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
|
|
120
121
|
| `WORKSPACES_DOMAIN_KEY` | - | The privkey.pem SSL Certificates for the `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
|
121
122
|
| `WORKSPACES_WILDCARD_CERT` | - | The fullchain.pem SSL Certificates for the Wildcard `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions.| No |
|
122
123
|
| `WORKSPACES_WILDCARD_KEY` | - | The privkey.pem SSL Certificates for the Wildcard `WORKSPACES_PROXY_DOMAIN`. See https://gitlab.com/gitlab-org/remote-development/gitlab-workspaces-proxy for instructions. | No |
|
124
|
+
| `QA_GITLAB_HOSTNAME` | `"gitlab-#{edition}-#{SecureRandom.hex(4)}"` | A host name for the GitLab instance setup with Test::Instance::Image. | No |
|
125
|
+
| `QA_GITLAB_USE_TLS` | false | Specify if GitLab instance setup with Test::Instance::Image should use TLS | No |
|
123
126
|
|
124
127
|
## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
|
125
128
|
|
@@ -571,7 +574,7 @@ $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
|
|
571
574
|
$ gitlab-qa Test::Integration::InstanceSAML EE
|
572
575
|
```
|
573
576
|
|
574
|
-
### `Test::
|
577
|
+
### `Test::Instance::Image CE|EE|<full image address> --omnibus-config oauth`
|
575
578
|
|
576
579
|
This tests that users can sign in to a GitLab instance using external OAuth services.
|
577
580
|
|
@@ -579,7 +582,7 @@ The tests currently integrate with the following OAuth service providers:
|
|
579
582
|
* GitHub
|
580
583
|
|
581
584
|
To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
|
582
|
-
container is spun up and tests are run from it by running the `Test::
|
585
|
+
container is spun up and tests are run from it by running the `Test::Instance::All` scenario
|
583
586
|
|
584
587
|
**Required environment variables:**
|
585
588
|
|
@@ -592,6 +595,8 @@ container is spun up and tests are run from it by running the `Test::Integration
|
|
592
595
|
- `QA_1P_PASSWORD`: Password for authenticating into 1Password for GitLab-QA vault. This can be found in the shared 1Password vault.
|
593
596
|
- `QA_1P_SECRET`: Secret for authenticating into 1Password. This can be found in the GitLab-QA 1Password vault.
|
594
597
|
- `QA_1P_GITHUB_UUID`: UUID for GitHub item in GitLab-QA 1Password vault. This can be found in the GitLab-QA 1Password vault.
|
598
|
+
- `QA_GITLAB_HOSTNAME`: Hostname set for GitLab instance. This must be set to `gitlab` as the external OAuth applications have been setup to use this.
|
599
|
+
- `QA_GITLAB_USE_TLS`: Use TLS for setting up GitLab instance. This must be set to `true` as since some external OAuth applications require the client to use TLS.
|
595
600
|
|
596
601
|
Example:
|
597
602
|
|
@@ -1169,6 +1174,28 @@ need to be updated, it can be useful to proxy all requests to real `GitHub` inst
|
|
1169
1174
|
|
1170
1175
|
Testing import [by direct transfer](https://docs.gitlab.com/ee/user/group/import/#migrate-groups-by-direct-transfer-recommended) is done by spinning up 2 omnibus installations - `import-target` and `import-source`. In order for tests to work, application setting `allow_local_requests_from_web_hooks_and_services` must be enabled in target instance. This is automatically done by test process if environment variable `QA_ALLOW_LOCAL_REQUESTS` is set to `true`.
|
1171
1176
|
|
1177
|
+
### `Test::Integration::AiGateway EE|<full image address>`
|
1178
|
+
|
1179
|
+
This scenario spins up a GitLab Omnibus instance integrated with a test AI Gateway using [fake models](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#faking-out-ai-models). It will run specs tagged with the `:ai_gateway` tag in order to help verify that cloud licensing and authentication for AI features work as expected for self-managed instances.
|
1180
|
+
|
1181
|
+
**Required environment variables:**
|
1182
|
+
|
1183
|
+
- `QA_EE_ACTIVATION_CODE`: An activation code for a Staging-generated Premium or Ultimate cloud license with a purchased AI add-on. This can be found in the GitLab QA 1Password vault.
|
1184
|
+
- `GITLAB_LICENSE_MODE`: Set to `test` in order to configure GitLab Omnibus with the correct license mode and `CUSTOMER_PORTAL_URL`.
|
1185
|
+
|
1186
|
+
**Optional environment variables:**
|
1187
|
+
|
1188
|
+
- `QA_USE_SYNC_SERVICE_TOKEN_WORKER`: When true, will enable the `use_sync_service_token_worker` feature flag during code suggestions setup to use the `SyncServiceTokenWorker` to fetch a code suggestions JWT during activation instead of the `SyncSeatLinkWorker`. See rollout issue https://gitlab.com/gitlab-org/gitlab/-/issues/431608 for details.
|
1189
|
+
|
1190
|
+
Example:
|
1191
|
+
|
1192
|
+
```shell
|
1193
|
+
$ export QA_EE_ACTIVATION_CODE="<value from 1Password>"
|
1194
|
+
$ export GITLAB_LICENSE_MODE="test"
|
1195
|
+
|
1196
|
+
$ gitlab-qa Test::Integration::AiGateway EE
|
1197
|
+
```
|
1198
|
+
|
1172
1199
|
----
|
1173
1200
|
|
1174
1201
|
[Back to README.md](../README.md)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Component
|
6
|
+
class AiGateway < Base
|
7
|
+
DOCKER_IMAGE = 'registry.gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/model-gateway'
|
8
|
+
DOCKER_IMAGE_TAG = 'latest'
|
9
|
+
|
10
|
+
def name
|
11
|
+
@name ||= 'ai-gateway'
|
12
|
+
end
|
13
|
+
|
14
|
+
def configure_environment(gitlab_hostname:)
|
15
|
+
@environment = {
|
16
|
+
'GITLAB_URL' => "http://#{gitlab_hostname}",
|
17
|
+
'GITLAB_API_URL' => "http://#{gitlab_hostname}/api/v4",
|
18
|
+
'CUSTOMER_PORTAL_BASE_URL' => Runtime::Env.customer_portal_url,
|
19
|
+
'USE_FAKE_MODELS' => true,
|
20
|
+
'USE_LOCAL_CACHE' => true
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -83,6 +83,13 @@ module Gitlab
|
|
83
83
|
@environment['ELASTIC_URL'] = url
|
84
84
|
end
|
85
85
|
|
86
|
+
def set_ee_activation_code
|
87
|
+
raise 'QA_EE_ACTIVATION_CODE is required!' if Runtime::Env.ee_activation_code.to_s.strip.empty?
|
88
|
+
|
89
|
+
@omnibus_gitlab_rails_env['QA_EE_ACTIVATION_CODE'] = Runtime::Env.ee_activation_code
|
90
|
+
secrets << Runtime::Env.ee_activation_code
|
91
|
+
end
|
92
|
+
|
86
93
|
def release=(release)
|
87
94
|
@release = QA::Release.new(release)
|
88
95
|
end
|
data/lib/gitlab/qa/runner.rb
CHANGED
@@ -156,7 +156,7 @@ module Gitlab
|
|
156
156
|
Runtime::Scenario.omnibus_exec_commands << configurator.exec_commands
|
157
157
|
|
158
158
|
# Load the configuration
|
159
|
-
|
159
|
+
Runtime::Scenario.omnibus_configuration << configurator.configuration
|
160
160
|
end
|
161
161
|
rescue NameError
|
162
162
|
raise <<~ERROR
|
@@ -81,6 +81,8 @@ module Gitlab
|
|
81
81
|
'QA_GITHUB_PASSWORD' => :qa_github_password,
|
82
82
|
'QA_FACEBOOK_USERNAME' => :qa_facebook_username,
|
83
83
|
'QA_FACEBOOK_PASSWORD' => :qa_facebook_password,
|
84
|
+
'QA_GITLAB_HOSTNAME' => :qa_gitlab_hostname,
|
85
|
+
'QA_GITLAB_USE_TLS' => :qa_gitlab_use_tls,
|
84
86
|
'KNAPSACK_GENERATE_REPORT' => :knapsack_generate_report,
|
85
87
|
'KNAPSACK_REPORT_PATH' => :knapsack_report_path,
|
86
88
|
'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
|
@@ -345,6 +347,10 @@ module Gitlab
|
|
345
347
|
enabled?(env_var_value_if_defined('QA_SKIP_PULL'), default: false)
|
346
348
|
end
|
347
349
|
|
350
|
+
def qa_gitlab_use_tls?
|
351
|
+
enabled?(env_var_value_if_defined('QA_GITLAB_USE_TLS'), default: false)
|
352
|
+
end
|
353
|
+
|
348
354
|
def geo_failover?
|
349
355
|
enabled?(env_var_value_if_defined('GEO_FAILOVER'), default: false)
|
350
356
|
end
|
@@ -422,6 +428,14 @@ module Gitlab
|
|
422
428
|
env_var_value_if_defined('CUSTOMER_PORTAL_URL') || 'https://customers.staging.gitlab.com'
|
423
429
|
end
|
424
430
|
|
431
|
+
def ee_activation_code
|
432
|
+
env_var_value_if_defined('QA_EE_ACTIVATION_CODE')
|
433
|
+
end
|
434
|
+
|
435
|
+
def use_sync_service_token_worker?
|
436
|
+
enabled?(env_var_value_if_defined('QA_USE_SYNC_SERVICE_TOKEN_WORKER'), default: false)
|
437
|
+
end
|
438
|
+
|
425
439
|
def geo_staging_url
|
426
440
|
env_var_value_if_defined('GEO_STAGING_URL') || 'https://geo.staging.gitlab.com'
|
427
441
|
end
|
@@ -6,11 +6,11 @@ module Gitlab
|
|
6
6
|
module OmnibusConfigurations
|
7
7
|
class FacebookOauth < Default
|
8
8
|
def configuration
|
9
|
-
Runtime::Env.
|
9
|
+
Runtime::Env.require_facebook_environment!
|
10
10
|
|
11
11
|
<<~OMNIBUS
|
12
12
|
gitlab_rails['omniauth_enabled'] = true
|
13
|
-
gitlab_rails['omniauth_allow_single_sign_on'] = [facebook']
|
13
|
+
gitlab_rails['omniauth_allow_single_sign_on'] = ['facebook']
|
14
14
|
gitlab_rails['omniauth_block_auto_created_users'] = false
|
15
15
|
gitlab_rails['omniauth_providers'] = [
|
16
16
|
{
|
@@ -18,7 +18,9 @@ module Gitlab
|
|
18
18
|
gitlab.release = release
|
19
19
|
gitlab.volumes = @volumes
|
20
20
|
gitlab.network = 'test'
|
21
|
+
gitlab.name = Runtime::Env.qa_gitlab_hostname
|
21
22
|
gitlab.seed_admin_token = @seed_admin_token
|
23
|
+
gitlab.tls = Runtime::Env.qa_gitlab_use_tls?
|
22
24
|
|
23
25
|
gitlab.instance do
|
24
26
|
Component::Specs.perform do |specs|
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Scenario
|
6
|
+
module Test
|
7
|
+
module Integration
|
8
|
+
class AiGateway < Scenario::Template
|
9
|
+
SETUP_SRC_PATH = File.expand_path('../../../../../../support/setup', __dir__)
|
10
|
+
SETUP_DEST_PATH = '/tmp/setup-scripts'
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@network = 'test'
|
14
|
+
@ai_gateway_name = 'ai-gateway'
|
15
|
+
@ai_gateway_hostname = "#{@ai_gateway_name}.#{@network}"
|
16
|
+
@ai_gateway_port = 5000
|
17
|
+
end
|
18
|
+
|
19
|
+
def perform(release, *rspec_args)
|
20
|
+
Component::Gitlab.perform do |gitlab|
|
21
|
+
setup_gitlab(gitlab, release)
|
22
|
+
|
23
|
+
Component::AiGateway.perform do |ai_gateway|
|
24
|
+
setup_ai_gateway(ai_gateway, gitlab_hostname: gitlab.hostname)
|
25
|
+
|
26
|
+
ai_gateway.instance do
|
27
|
+
gitlab.instance do
|
28
|
+
setup_code_suggestions(gitlab)
|
29
|
+
run_specs(gitlab, *rspec_args)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def setup_gitlab(gitlab, release)
|
39
|
+
gitlab.release = QA::Release.new(release)
|
40
|
+
gitlab.name = 'gitlab'
|
41
|
+
gitlab.network = @network
|
42
|
+
|
43
|
+
gitlab.omnibus_gitlab_rails_env['CODE_SUGGESTIONS_BASE_URL'] = "http://#{@ai_gateway_hostname}:#{@ai_gateway_port}"
|
44
|
+
|
45
|
+
# Determines whether to use the SyncServiceTokenWorker or SyncSeatLinkWorker
|
46
|
+
# for generating a code suggestions access token during license activation
|
47
|
+
gitlab.omnibus_gitlab_rails_env['QA_USE_SYNC_SERVICE_TOKEN_WORKER'] = Runtime::Env.use_sync_service_token_worker?
|
48
|
+
|
49
|
+
gitlab.set_ee_activation_code
|
50
|
+
end
|
51
|
+
|
52
|
+
def setup_ai_gateway(ai_gateway, gitlab_hostname:)
|
53
|
+
ai_gateway.name = @ai_gateway_name
|
54
|
+
ai_gateway.network = @network
|
55
|
+
ai_gateway.ports = [@ai_gateway_port]
|
56
|
+
|
57
|
+
ai_gateway.configure_environment(gitlab_hostname: gitlab_hostname)
|
58
|
+
end
|
59
|
+
|
60
|
+
def setup_code_suggestions(gitlab)
|
61
|
+
Runtime::Logger.info('Setting up Code Suggestions on GitLab instance')
|
62
|
+
|
63
|
+
gitlab.docker.copy(gitlab.name, SETUP_SRC_PATH, SETUP_DEST_PATH)
|
64
|
+
|
65
|
+
gitlab.docker.exec(
|
66
|
+
gitlab.name,
|
67
|
+
"gitlab-rails runner #{SETUP_DEST_PATH}/code_suggestions_setup.rb",
|
68
|
+
mask_secrets: gitlab.secrets
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
def run_specs(gitlab, *rspec_args)
|
73
|
+
Runtime::Logger.info('Running AI Gateway specs!')
|
74
|
+
|
75
|
+
rspec_args << "--" unless rspec_args.include?('--')
|
76
|
+
rspec_args << %w[--tag ai_gateway]
|
77
|
+
|
78
|
+
Component::Specs.perform do |specs|
|
79
|
+
specs.suite = 'Test::Instance::All'
|
80
|
+
specs.release = gitlab.release
|
81
|
+
specs.network = gitlab.network
|
82
|
+
specs.args = [gitlab.address, *rspec_args]
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -180,8 +180,7 @@ module Gitlab
|
|
180
180
|
logger.info("Fetching Docker tags page #{page} from 'gitlab/gitlab-#{edition}' registry")
|
181
181
|
response = HttpRequest.make_http_request(
|
182
182
|
url: "https://registry.hub.docker.com/v2/namespaces/gitlab/repositories/gitlab-#{edition}/tags?page=#{page}&page_size=#{per_page}",
|
183
|
-
fail_on_error: false
|
184
|
-
params: nil # DockerHub fails with 413 if default {} being passed
|
183
|
+
fail_on_error: false
|
185
184
|
)
|
186
185
|
|
187
186
|
unless response.code == 200
|
@@ -8,7 +8,7 @@ module Gitlab
|
|
8
8
|
module Support
|
9
9
|
class HttpRequest
|
10
10
|
# rubocop:disable Metrics/AbcSize
|
11
|
-
def self.make_http_request(method: 'get', url: nil, params:
|
11
|
+
def self.make_http_request(method: 'get', url: nil, params: nil, headers: {}, show_response: false, fail_on_error: true)
|
12
12
|
raise "URL not defined for making request. Exiting..." unless url
|
13
13
|
|
14
14
|
res = HTTP.follow.method(method).call(url, json: params, headers: headers)
|
data/lib/gitlab/qa/version.rb
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class CodeSuggestionsSetup
|
4
|
+
class << self
|
5
|
+
def configure!
|
6
|
+
if ENV.fetch('QA_USE_SYNC_SERVICE_TOKEN_WORKER', false)
|
7
|
+
puts 'Enabling use_sync_service_token_worker feature flag...'
|
8
|
+
Feature.enable(:use_sync_service_token_worker)
|
9
|
+
end
|
10
|
+
|
11
|
+
puts 'Enabling code_suggestions_tokens_api feature flag...'
|
12
|
+
Feature.enable(:code_suggestions_tokens_api)
|
13
|
+
|
14
|
+
activate_cloud_license
|
15
|
+
|
16
|
+
# Due to the various async Sidekiq processes involved, we wait to verify
|
17
|
+
# that the code suggestions access token has been generated before proceeding
|
18
|
+
verify_code_suggestions_access_token
|
19
|
+
|
20
|
+
puts 'Enabling application setting instance_level_code_suggestions_enabled...'
|
21
|
+
ApplicationSetting.last.update(instance_level_code_suggestions_enabled: true)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def activate_cloud_license
|
27
|
+
puts 'Activating cloud license...'
|
28
|
+
activation_result = ::GitlabSubscriptions::ActivateService.new.execute(ENV.fetch('QA_EE_ACTIVATION_CODE', nil))
|
29
|
+
|
30
|
+
if activation_result[:success]
|
31
|
+
puts 'Cloud license activation successful'
|
32
|
+
else
|
33
|
+
puts 'Cloud license activation failed!'
|
34
|
+
puts Array(result[:errors]).join(' ')
|
35
|
+
exit 1
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def verify_code_suggestions_access_token
|
40
|
+
puts 'Waiting for code suggestions access token to be available...'
|
41
|
+
|
42
|
+
max_attempts = 3
|
43
|
+
attempts = 0
|
44
|
+
|
45
|
+
until (tokens = ::Ai::ServiceAccessToken.active.count)&.positive? || attempts == max_attempts
|
46
|
+
puts 'Attempting to verify access token exists...'
|
47
|
+
attempts += 1
|
48
|
+
sleep 30
|
49
|
+
end
|
50
|
+
|
51
|
+
return if tokens&.positive?
|
52
|
+
|
53
|
+
puts "Failed to create code suggestions access token after #{max_attempts} attempts"
|
54
|
+
exit 1
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
CodeSuggestionsSetup.configure!
|
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:
|
4
|
+
version: 13.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: 2023-12-
|
11
|
+
date: 2023-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -383,6 +383,7 @@ files:
|
|
383
383
|
- gitlab-qa.gemspec
|
384
384
|
- lefthook.yml
|
385
385
|
- lib/gitlab/qa.rb
|
386
|
+
- lib/gitlab/qa/component/ai_gateway.rb
|
386
387
|
- lib/gitlab/qa/component/alpine.rb
|
387
388
|
- lib/gitlab/qa/component/base.rb
|
388
389
|
- lib/gitlab/qa/component/chaos.rb
|
@@ -444,6 +445,7 @@ files:
|
|
444
445
|
- lib/gitlab/qa/scenario/test/instance/staging_geo.rb
|
445
446
|
- lib/gitlab/qa/scenario/test/instance/staging_ref.rb
|
446
447
|
- lib/gitlab/qa/scenario/test/instance/staging_ref_geo.rb
|
448
|
+
- lib/gitlab/qa/scenario/test/integration/ai_gateway.rb
|
447
449
|
- lib/gitlab/qa/scenario/test/integration/chaos.rb
|
448
450
|
- lib/gitlab/qa/scenario/test/integration/client_ssl.rb
|
449
451
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
@@ -462,7 +464,6 @@ files:
|
|
462
464
|
- lib/gitlab/qa/scenario/test/integration/mattermost.rb
|
463
465
|
- lib/gitlab/qa/scenario/test/integration/metrics.rb
|
464
466
|
- lib/gitlab/qa/scenario/test/integration/mtls.rb
|
465
|
-
- lib/gitlab/qa/scenario/test/integration/oauth.rb
|
466
467
|
- lib/gitlab/qa/scenario/test/integration/opensearch.rb
|
467
468
|
- lib/gitlab/qa/scenario/test/integration/praefect.rb
|
468
469
|
- lib/gitlab/qa/scenario/test/integration/registry.rb
|
@@ -497,6 +498,7 @@ files:
|
|
497
498
|
- support/manifests/suggested_reviewer/pubsub.yaml
|
498
499
|
- support/manifests/suggested_reviewer/recommender-bot.yaml
|
499
500
|
- support/manifests/suggested_reviewer/recommender.yaml
|
501
|
+
- support/setup/code_suggestions_setup.rb
|
500
502
|
- tls_certificates/authority/ca.crt
|
501
503
|
- tls_certificates/authority/ca.key
|
502
504
|
- tls_certificates/authority/ca.pem
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'yaml'
|
4
|
-
|
5
|
-
module Gitlab
|
6
|
-
module QA
|
7
|
-
module Scenario
|
8
|
-
module Test
|
9
|
-
module Integration
|
10
|
-
class OAuth < Scenario::Template
|
11
|
-
attr_reader :gitlab_name
|
12
|
-
|
13
|
-
def initialize
|
14
|
-
@gitlab_name = 'gitlab'
|
15
|
-
end
|
16
|
-
|
17
|
-
def perform(release, *rspec_args)
|
18
|
-
Runtime::Env.require_oauth_environment!
|
19
|
-
|
20
|
-
release = Release.new(release)
|
21
|
-
|
22
|
-
Component::Gitlab.perform do |gitlab|
|
23
|
-
gitlab.release = release
|
24
|
-
gitlab.network = 'test'
|
25
|
-
gitlab.name = gitlab_name
|
26
|
-
gitlab.tls = true
|
27
|
-
|
28
|
-
gitlab.omnibus_configuration << gitlab_omnibus_configuration(gitlab.address)
|
29
|
-
|
30
|
-
gitlab.instance do
|
31
|
-
Runtime::Logger.info('Running OAuth specs!')
|
32
|
-
|
33
|
-
Component::Specs.perform do |specs|
|
34
|
-
rspec_args << '--' unless rspec_args.include?('--')
|
35
|
-
rspec_args << %w[--tag oauth]
|
36
|
-
specs.suite = 'Test::Instance::All'
|
37
|
-
specs.release = release
|
38
|
-
specs.network = gitlab.network
|
39
|
-
specs.args = [gitlab.address, *rspec_args]
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
private
|
46
|
-
|
47
|
-
def gitlab_omnibus_configuration(gitlab_address)
|
48
|
-
<<~OMNIBUS
|
49
|
-
gitlab_rails['omniauth_enabled'] = true;
|
50
|
-
gitlab_rails['omniauth_allow_single_sign_on'] = ['github', 'facebook'];
|
51
|
-
gitlab_rails['omniauth_block_auto_created_users'] = false;
|
52
|
-
gitlab_rails['omniauth_providers'] = [
|
53
|
-
{
|
54
|
-
name: 'github',
|
55
|
-
app_id: '$QA_GITHUB_OAUTH_APP_ID',
|
56
|
-
app_secret: '$QA_GITHUB_OAUTH_APP_SECRET',
|
57
|
-
url: 'https://github.com/',
|
58
|
-
verify_ssl: false,
|
59
|
-
args: { scope: 'user:email' }
|
60
|
-
},
|
61
|
-
{
|
62
|
-
name: 'facebook',
|
63
|
-
app_id: '$QA_FACEBOOK_OAUTH_APP_ID',
|
64
|
-
app_secret: '$QA_FACEBOOK_OAUTH_APP_SECRET',
|
65
|
-
verify_ssl: false
|
66
|
-
}
|
67
|
-
];
|
68
|
-
letsencrypt['enable'] = false;
|
69
|
-
external_url '#{gitlab_address}';
|
70
|
-
OMNIBUS
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|