gitlab-qa 8.15.1 → 8.15.2

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: 152cd35b57e1bbf009afe181668f3a6e649f817c722ff6307ef9f556191151d7
4
- data.tar.gz: 83ea90cac64da14866e36233a43d787236df0e345512de7599ed0f6546cea0ed
3
+ metadata.gz: 5e196210d260a788803b5c5d8109b645d8acc3e8d1a60a5bd8ab46110dc94aa9
4
+ data.tar.gz: c656c359e25150a2e8fde966aee83ca704924704149e6b3413519d9753123590
5
5
  SHA512:
6
- metadata.gz: 8dbacb3d78dae237acb357bca6e36c271aea9fd0a06bfba6adaec924a62045afa16d4f94299a2a262af0682dcd52feb701bd69ca1b893242ae456976d954a3d3
7
- data.tar.gz: 226b3b3639a998ad756849ab41937afcee5e1265586f61a1ef3113cee6a2325def40c457a64a2c2445129816d959e7ebd3591fc35f462f70807941414bd844eb
6
+ metadata.gz: 4a6a2bd9405ae3fb3a972609e94d82412f037340c15f9d55a64ff12b6e11aec7e71e730697857de43493b4fea8e022e167f23a98caba4992bf49e06339ca8caa
7
+ data.tar.gz: 75adc84ac465f2c1f1d2d4ebc4d2c511c929c9b4c5a04b84b7f78fef12e3de9989aca9df7a69a2b359cc66196e1849cd0d25fc8d9432cabb45cff083006e1a67
@@ -192,29 +192,6 @@ relate_test_failures:
192
192
  - export GITLAB_QA_ACCESS_TOKEN="$GITLAB_QA_PRODUCTION_ACCESS_TOKEN"
193
193
  - bundle exec exe/gitlab-qa-report --relate-failure-issue "gitlab-qa-run-*/**/rspec-*.json" --project "$QA_FAILURES_REPORTING_PROJECT" --max-diff-ratio "$QA_FAILURES_MAX_DIFF_RATIO" $QA_FAILURES_REPORTER_OPTIONS
194
194
 
195
- .notify_upstream:
196
- stage: notify
197
- image: ruby:3.0-alpine
198
- dependencies: []
199
- before_script:
200
- - gem install gitlab --no-document
201
-
202
- notify_upstream:success:
203
- extends: .notify_upstream
204
- script:
205
- - bin/notify_upstream success
206
- rules:
207
- - if: '$TOP_UPSTREAM_SOURCE_PROJECT && $TOP_UPSTREAM_MERGE_REQUEST_IID && $TOP_UPSTREAM_SOURCE_SHA'
208
- when: on_success
209
-
210
- notify_upstream:failure:
211
- extends: .notify_upstream
212
- script:
213
- - bin/notify_upstream failure
214
- rules:
215
- - if: '$TOP_UPSTREAM_SOURCE_PROJECT && $TOP_UPSTREAM_MERGE_REQUEST_IID && $TOP_UPSTREAM_SOURCE_SHA'
216
- when: on_failure
217
-
218
195
  .notify_slack:
219
196
  image: alpine
220
197
  stage: notify
@@ -10,6 +10,7 @@ ce:decomposition_multiple_db:
10
10
  parallel: 5
11
11
  variables:
12
12
  GITLAB_QA_OPTIONS_COMBINED: "$GITLAB_QA_OPTIONS --omnibus-config decomposition_multiple_db"
13
+ GITLAB_ALLOW_SEPARATE_CI_DATABASE: "true"
13
14
 
14
15
  ee:decomposition_multiple_db:
15
16
  extends:
@@ -23,3 +24,4 @@ ee:decomposition_multiple_db:
23
24
  parallel: 5
24
25
  variables:
25
26
  GITLAB_QA_OPTIONS_COMBINED: "$GITLAB_QA_OPTIONS --omnibus-config decomposition_multiple_db"
27
+ GITLAB_ALLOW_SEPARATE_CI_DATABASE: "true"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (8.15.1)
4
+ gitlab-qa (8.15.2)
5
5
  activesupport (~> 6.1)
6
6
  gitlab (~> 4.18.0)
7
7
  http (~> 5.0)
@@ -14,7 +14,7 @@ module Gitlab
14
14
 
15
15
  def initialize
16
16
  super
17
- self.release = 'EE'
17
+ self.release = 'CE'
18
18
  @cluster_config = Component::GitalyCluster::GitalyClusterConfig.new
19
19
  @gitaly_port = 8075
20
20
  @ports = [gitaly_port]
@@ -28,6 +28,12 @@ module Gitlab
28
28
  @release = QA::Release.new(release)
29
29
  end
30
30
 
31
+ def pull
32
+ docker.login(**release.login_params) if release.login_params
33
+
34
+ super
35
+ end
36
+
31
37
  def reconfigure
32
38
  setup_omnibus
33
39
  @docker.attach(name) do |line, wait|
@@ -28,7 +28,8 @@ module Gitlab
28
28
  :seed_admin_token,
29
29
  :seed_db,
30
30
  :skip_server_hooks,
31
- :gitaly_tls
31
+ :gitaly_tls,
32
+ :secrets
32
33
 
33
34
  attr_writer :name, :relative_path
34
35
 
@@ -50,6 +51,7 @@ module Gitlab
50
51
  @seed_admin_token = Runtime::Scenario.seed_admin_token
51
52
  @seed_db = Runtime::Scenario.seed_db
52
53
  @skip_server_hooks = Runtime::Scenario.skip_server_hooks
54
+ @secrets = []
53
55
 
54
56
  self.release = 'CE'
55
57
  end
@@ -64,7 +66,16 @@ module Gitlab
64
66
  return unless Runtime::Env.test_license_mode?
65
67
 
66
68
  @omnibus_gitlab_rails_env['GITLAB_LICENSE_MODE'] = 'test'
67
- @omnibus_gitlab_rails_env['CUSTOMER_PORTAL_URL'] = 'https://customers.staging.gitlab.com'
69
+ @omnibus_gitlab_rails_env['CUSTOMER_PORTAL_URL'] = Runtime::Env.customer_portal_url
70
+ end
71
+
72
+ # Sets GITLAB_QA_USER_AGENT as a Rail environment variable so that it can be used by GitLab to bypass features
73
+ # that can't be automated.
74
+ def set_qa_user_agent
75
+ return if Runtime::Env.gitlab_qa_user_agent.to_s.strip.empty?
76
+
77
+ @omnibus_gitlab_rails_env['GITLAB_QA_USER_AGENT'] = Runtime::Env.gitlab_qa_user_agent
78
+ secrets << Runtime::Env.gitlab_qa_user_agent
68
79
  end
69
80
 
70
81
  def elastic_url=(url)
@@ -119,9 +130,14 @@ module Gitlab
119
130
  def prepare_gitlab_omnibus_config
120
131
  set_formless_login_token
121
132
  set_license_mode
122
- return if omnibus_gitlab_rails_env.empty?
133
+ set_qa_user_agent
134
+ env = @omnibus_gitlab_rails_env.merge(
135
+ {
136
+ 'GITLAB_ALLOW_SEPARATE_CI_DATABASE' => Runtime::Env.allow_separate_ci_database.to_s
137
+ }
138
+ )
123
139
 
124
- @omnibus_configuration << "gitlab_rails['env'] = #{@omnibus_gitlab_rails_env}"
140
+ @omnibus_configuration << "gitlab_rails['env'] = #{env}"
125
141
  end
126
142
 
127
143
  def start # rubocop:disable Metrics/AbcSize
@@ -203,7 +219,7 @@ module Gitlab
203
219
  return if commands.empty?
204
220
 
205
221
  Runtime::Logger.info("Running exec_commands...")
206
- commands.each { |command| @docker.exec(name, command) }
222
+ commands.each { |command| @docker.exec(name, command, mask_secrets: secrets) }
207
223
  end
208
224
 
209
225
  def rails_version
@@ -263,7 +279,7 @@ module Gitlab
263
279
  end
264
280
 
265
281
  def setup_omnibus
266
- @docker.write_files(name) do |f|
282
+ @docker.write_files(name, mask_secrets: secrets) do |f|
267
283
  f.write('/etc/gitlab/gitlab.rb', @omnibus_configuration.to_s)
268
284
  end
269
285
  end
@@ -14,7 +14,7 @@ module Gitlab
14
14
 
15
15
  def initialize
16
16
  super
17
- self.release = 'EE'
17
+ self.release = 'CE'
18
18
  @cluster_config = Component::GitalyCluster::GitalyClusterConfig.new
19
19
  @ports = [cluster_config.praefect_port]
20
20
  end
@@ -27,6 +27,12 @@ module Gitlab
27
27
  @release = QA::Release.new(release)
28
28
  end
29
29
 
30
+ def pull
31
+ docker.login(**release.login_params) if release.login_params
32
+
33
+ super
34
+ end
35
+
30
36
  def reconfigure
31
37
  setup_omnibus
32
38
  @docker.attach(name) do |line|
@@ -58,7 +58,7 @@ module Gitlab
58
58
  # This is content
59
59
  # That goes within /opt/other
60
60
  # TEXT)
61
- def write_files(name)
61
+ def write_files(name, mask_secrets: nil)
62
62
  exec(name, yield(
63
63
  Class.new do
64
64
  # @param file The name of the file
@@ -76,13 +76,13 @@ module Gitlab
76
76
  %(echo "#{contents}" >> #{file};)
77
77
  end
78
78
  end
79
- ))
79
+ ), mask_secrets: mask_secrets)
80
80
  end
81
81
 
82
- def exec(name, command)
82
+ def exec(name, command, mask_secrets: nil)
83
83
  cmd = ['exec']
84
84
  cmd << '--privileged' if privileged_command?(command)
85
- Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"))
85
+ Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"), mask_secrets: mask_secrets)
86
86
  end
87
87
 
88
88
  def read_file(image, tag, path, &block)
@@ -369,14 +369,22 @@ module Gitlab
369
369
  env_var_value_if_defined('QA_COM_REGISTRY') || 'registry.gitlab.com'
370
370
  end
371
371
 
372
+ def customer_portal_url
373
+ env_var_value_if_defined('CUSTOMER_PORTAL_URL') || 'https://customers.staging.gitlab.com'
374
+ end
375
+
376
+ def allow_separate_ci_database
377
+ enabled?(env_var_value_if_defined('GITLAB_ALLOW_SEPARATE_CI_DATABASE'), default: false)
378
+ end
379
+
380
+ private
381
+
372
382
  def enabled?(value, default: true)
373
383
  return default if value.nil?
374
384
 
375
385
  (value =~ /^(false|no|0)$/i) != 0
376
386
  end
377
387
 
378
- private
379
-
380
388
  def env_var_value_valid?(variable)
381
389
  !ENV[variable].blank?
382
390
  end
@@ -15,7 +15,7 @@ module Gitlab
15
15
 
16
16
  # Customer Portal URL that is targeted
17
17
  def customer_portal_url
18
- ENV.fetch('CUSTOMER_PORTAL_URL', 'https://customers.staging.gitlab.com')
18
+ Runtime::Env.customer_portal_url
19
19
  end
20
20
  end
21
21
  end
@@ -25,6 +25,7 @@ module Gitlab
25
25
  Component::Gitlab.perform do |gitlab|
26
26
  Component::GitalyCluster.perform do |cluster|
27
27
  cluster.config = @config
28
+ cluster.release = release
28
29
  # we need to get an IP for praefect before proceeding so it cannot be run in parallel with gitlab
29
30
  cluster.instance(true).join
30
31
  end
@@ -21,7 +21,10 @@ module Gitlab
21
21
  gitlab.name = config.gitlab_name
22
22
  gitlab.network = config.network
23
23
  gitlab.omnibus_configuration << gitlab_omnibus_configuration
24
- cluster = Component::GitalyCluster.perform(&:instance)
24
+ cluster = Component::GitalyCluster.perform do |cluster|
25
+ cluster.release = release
26
+ cluster.instance
27
+ end
25
28
  gitlab.instance do
26
29
  cluster.join
27
30
  Runtime::Logger.info('Running Gitaly Cluster specs!')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '8.15.1'
5
+ VERSION = '8.15.2'
6
6
  end
7
7
  end
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: 8.15.1
4
+ version: 8.15.2
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-01-06 00:00:00.000000000 Z
11
+ date: 2023-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -318,7 +318,6 @@ files:
318
318
  - bin/expect_exit_code_and_text
319
319
  - bin/gen-cert.sh
320
320
  - bin/merge_html_reports
321
- - bin/notify_upstream
322
321
  - bin/setup
323
322
  - bin/slack
324
323
  - docs/README.md
data/bin/notify_upstream DELETED
@@ -1,98 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'gitlab'
5
-
6
- # Default to "Multi-pipeline (from 'gitlab-org/gitlab-qa' 'notify_upstream:*' jobs)" from current project
7
- api_token = ENV.fetch('GITLAB_QA_PROJECT_ACCESS_TOKEN') do
8
- puts "The $GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN variable is deprecated in favor of a dedicated project access token: $GITLAB_QA_PROJECT_ACCESS_TOKEN."
9
- puts "See https://gitlab.com/groups/gitlab-org/quality/-/epics/17 for more details."
10
- ENV['GITLAB_BOT_MULTI_PROJECT_PIPELINE_POLLING_TOKEN']
11
- end
12
-
13
- # Configure credentials to be used with gitlab gem
14
- Gitlab.configure do |config|
15
- config.endpoint = 'https://gitlab.com/api/v4'
16
- config.private_token = api_token
17
- end
18
-
19
- class CommitComment
20
- UPSTREAM_COMMENT = <<~COMMENT
21
- - The [`gitlab-qa-mirror` downstream pipeline](%<pipeline_url>s) for https://gitlab.com/%<project_path>s/-/merge_requests/%<mr_iid>s/diffs?commit_id=%<commit_sha>s %<status_with_icon>s
22
- COMMENT
23
- IDENTIFIABLE_NOTE_TAG = 'gitlab-qa:upstream-notification-note'
24
-
25
- def self.mr?
26
- ENV.key?('TOP_UPSTREAM_SOURCE_PROJECT') &&
27
- ENV.key?('TOP_UPSTREAM_MERGE_REQUEST_IID') &&
28
- ENV.key?('TOP_UPSTREAM_SOURCE_SHA') &&
29
- !ENV['TOP_UPSTREAM_SOURCE_PROJECT'].to_s.empty? &&
30
- !ENV['TOP_UPSTREAM_MERGE_REQUEST_IID'].to_s.empty? &&
31
- !ENV['TOP_UPSTREAM_SOURCE_SHA'].to_s.empty?
32
- end
33
-
34
- def self.post!(status)
35
- unless mr?
36
- puts "All the 'TOP_UPSTREAM_SOURCE_PROJECT', 'TOP_UPSTREAM_MERGE_REQUEST_IID', and 'TOP_UPSTREAM_SOURCE_SHA' environment variables need to be present. We cannot post a comment on the upstream merge request."
37
- return
38
- end
39
-
40
- # Look for an existing note
41
- upstream_notification_note = Gitlab.merge_request_notes(project_path, mr_iid).auto_paginate.find do |note|
42
- note.body.include?(IDENTIFIABLE_NOTE_TAG)
43
- end
44
-
45
- if upstream_notification_note
46
- Gitlab.edit_merge_request_note(project_path, mr_iid, upstream_notification_note.id, [upstream_notification_note.body, build_comment(status)].join("\n"))
47
- else
48
- Gitlab.create_merge_request_comment(project_path, mr_iid, "<!-- #{IDENTIFIABLE_NOTE_TAG} -->\n#{build_comment(status)}")
49
- end
50
- rescue Gitlab::Error::Error => error
51
- puts "Ignoring the following error: #{error}"
52
- end
53
-
54
- def self.project_path
55
- ENV['TOP_UPSTREAM_SOURCE_PROJECT']
56
- end
57
-
58
- def self.mr_iid
59
- ENV['TOP_UPSTREAM_MERGE_REQUEST_IID']
60
- end
61
-
62
- def self.pipeline_url
63
- ENV['CI_PIPELINE_URL']
64
- end
65
-
66
- def self.commit_sha
67
- ENV['TOP_UPSTREAM_SOURCE_SHA']
68
- end
69
-
70
- def self.build_comment(status)
71
- format(UPSTREAM_COMMENT,
72
- project_path: project_path,
73
- mr_iid: mr_iid,
74
- pipeline_url: pipeline_url,
75
- status_with_icon: status_with_icon(status),
76
- commit_sha: commit_sha
77
- )
78
- end
79
-
80
- def self.status_with_icon(status)
81
- case status
82
- when :success
83
- "passed. :white_check_mark:"
84
- when :failure
85
- "failed! :boom:"
86
- end
87
- end
88
-
89
- def self.post_to_mr(project_id, mr_iid, comment)
90
- Gitlab.create_merge_request_comment(project_id, mr_iid, comment)
91
- end
92
- end
93
-
94
- status = ARGV.shift.to_s.strip
95
-
96
- abort "Please provide a status!" if status == ''
97
-
98
- CommitComment.post!(status.to_sym)