gitlab-qa 8.4.1 → 8.5.0
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/.gitlab/ci/jobs/base.gitlab-ci.yml +1 -3
- data/.rubocop_todo.yml +0 -12
- data/Gemfile.lock +1 -1
- data/exe/gitlab-qa +1 -1
- data/lib/gitlab/qa/component/base.rb +2 -2
- data/lib/gitlab/qa/component/gitlab.rb +1 -1
- data/lib/gitlab/qa/component/staging.rb +17 -35
- data/lib/gitlab/qa/component/suggested_reviewer.rb +47 -0
- data/lib/gitlab/qa/docker/command.rb +3 -14
- data/lib/gitlab/qa/docker/engine.rb +1 -1
- data/lib/gitlab/qa/release.rb +6 -2
- data/lib/gitlab/qa/report/results_reporter_shared.rb +1 -1
- data/lib/gitlab/qa/runtime/env.rb +7 -0
- data/lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb +62 -0
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +1 -1
- data/lib/gitlab/qa/service/cluster_provider/base.rb +33 -0
- data/lib/gitlab/qa/service/cluster_provider/k3d.rb +141 -0
- data/lib/gitlab/qa/service/kubernetes_cluster.rb +62 -0
- data/lib/gitlab/qa/support/gitlab_version_info.rb +4 -1
- data/lib/gitlab/qa/support/shell_command.rb +98 -0
- data/lib/gitlab/qa/support/shellout.rb +16 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +1 -1
- data/support/manifests/suggested_reviewer/authenticator.yaml +41 -0
- data/support/manifests/suggested_reviewer/postgres.yaml +84 -0
- data/support/manifests/suggested_reviewer/pubsub.yaml +41 -0
- data/support/manifests/suggested_reviewer/recommender-bot.yaml +242 -0
- data/support/manifests/suggested_reviewer/recommender.yaml +52 -0
- metadata +14 -4
- data/lib/gitlab/qa/docker/shellout.rb +0 -77
- data/lib/gitlab/qa/support/dev_ee_qa_image.rb +0 -54
@@ -1,77 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'open3'
|
4
|
-
require 'active_support/core_ext/string/filters'
|
5
|
-
|
6
|
-
module Gitlab
|
7
|
-
module QA
|
8
|
-
module Docker
|
9
|
-
class Shellout
|
10
|
-
using Rainbow
|
11
|
-
|
12
|
-
StatusError = Class.new(StandardError)
|
13
|
-
|
14
|
-
def initialize(command)
|
15
|
-
@command = command
|
16
|
-
@output = []
|
17
|
-
@logger = Runtime::Logger.logger
|
18
|
-
end
|
19
|
-
|
20
|
-
attr_reader :command, :output
|
21
|
-
|
22
|
-
def execute! # rubocop:disable Metrics/AbcSize
|
23
|
-
raise StatusError, 'Command already executed' if output.any?
|
24
|
-
|
25
|
-
logger.info("Docker shell command: `#{command.mask_secrets.cyan}`")
|
26
|
-
|
27
|
-
Open3.popen2e(@command.to_s) do |_in, out, wait|
|
28
|
-
out.each do |line|
|
29
|
-
output.push(line)
|
30
|
-
|
31
|
-
if stream_progress
|
32
|
-
print "."
|
33
|
-
elsif command.stream_output
|
34
|
-
puts line
|
35
|
-
end
|
36
|
-
|
37
|
-
yield line, wait if block_given?
|
38
|
-
end
|
39
|
-
puts if stream_progress && !output.empty?
|
40
|
-
|
41
|
-
fail! if wait.value.exited? && wait.value.exitstatus.nonzero?
|
42
|
-
|
43
|
-
logger.debug("Docker shell command output:\n#{string_output}") unless command.stream_output || output.empty?
|
44
|
-
end
|
45
|
-
|
46
|
-
string_output
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
|
51
|
-
attr_reader :logger
|
52
|
-
|
53
|
-
# Raise error and print output to error log level
|
54
|
-
#
|
55
|
-
# @return [void]
|
56
|
-
def fail!
|
57
|
-
logger.error("Docker shell command output:\n#{string_output}") unless command.stream_output
|
58
|
-
raise StatusError, "Docker command `#{command.mask_secrets.truncate(100)}` failed! " + "✘".red
|
59
|
-
end
|
60
|
-
|
61
|
-
# Stream only command execution progress and log output when command finished
|
62
|
-
#
|
63
|
-
# @return [Boolean]
|
64
|
-
def stream_progress
|
65
|
-
!(Runtime::Env.ci || command.stream_output)
|
66
|
-
end
|
67
|
-
|
68
|
-
# Stringified command output
|
69
|
-
#
|
70
|
-
# @return [String]
|
71
|
-
def string_output
|
72
|
-
output.join.chomp
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
require 'uri'
|
5
|
-
|
6
|
-
module Gitlab
|
7
|
-
module QA
|
8
|
-
module Support
|
9
|
-
class DevEEQAImage
|
10
|
-
attr_reader :base_url
|
11
|
-
|
12
|
-
DEV_ADDRESS = 'https://dev.gitlab.org'
|
13
|
-
GITLAB_EE_QA_REPOSITORY_ID = 55
|
14
|
-
QAImageNotFoundError = Class.new(StandardError)
|
15
|
-
|
16
|
-
def initialize
|
17
|
-
@base_url = "#{DEV_ADDRESS}/api/v4/projects/gitlab%2Fomnibus-gitlab/registry/repositories/#{GITLAB_EE_QA_REPOSITORY_ID}/tags?per_page=100"
|
18
|
-
|
19
|
-
Runtime::Env.require_qa_dev_access_token!
|
20
|
-
end
|
21
|
-
|
22
|
-
def retrieve_image_from_container_registry!(revision)
|
23
|
-
request_url = base_url
|
24
|
-
|
25
|
-
begin
|
26
|
-
response = api_get!(URI.parse(request_url))
|
27
|
-
tags = JSON.parse(response.body)
|
28
|
-
|
29
|
-
matching_qa_image_tag = find_matching_qa_image_tag(tags, revision)
|
30
|
-
return matching_qa_image_tag['location'] if matching_qa_image_tag
|
31
|
-
|
32
|
-
request_url = next_page_url_from_response(response)
|
33
|
-
end while request_url
|
34
|
-
|
35
|
-
raise QAImageNotFoundError, "No `gitlab-ee-qa` image could be found for the revision `#{revision}`."
|
36
|
-
end
|
37
|
-
|
38
|
-
private
|
39
|
-
|
40
|
-
def api_get!(uri)
|
41
|
-
Support::GetRequest.new(uri, Runtime::Env.qa_dev_access_token).execute!
|
42
|
-
end
|
43
|
-
|
44
|
-
def next_page_url_from_response(response)
|
45
|
-
response['x-next-page'].to_s != '' ? "#{base_url}&page=#{response['x-next-page']}" : nil
|
46
|
-
end
|
47
|
-
|
48
|
-
def find_matching_qa_image_tag(tags, revision)
|
49
|
-
tags.find { |tag| tag['name'].end_with?(revision) }
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|