gitlab-qa 15.8.0 → 15.9.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/Gemfile.lock +1 -1
- data/docs/what_tests_can_be_run.md +6 -2
- data/gitlab-qa.gemspec +5 -0
- data/lib/gitlab/qa/component/ldap.rb +2 -1
- data/lib/gitlab/qa/support/gitlab_upgrade_path.rb +78 -2
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62f35e5b964b9eebe81ee065da70d428ad6a92e42146ece90c99cb058992608d
|
|
4
|
+
data.tar.gz: dadb71a13c7fc0d5c16f939d87e004ef70bba72468624ed089fb7b6592f647ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e39b28201d0ae2d1f4fce45b6b37960ca2269072ffafdd0d245d35d99f7d69eafc5cd93cf0aed3b253ebf03debd57862709995ca31702ab23e490972879ca334
|
|
7
|
+
data.tar.gz: bb8ab755a2fb9edb127bf7c17d8949d000acf3e75a5b1c2fabfc6ef5b0895588836ca8ac0e0c790f9ebd7d21a48665b1ea95c13c7d1b18103bbb97ee58864fec
|
data/Gemfile.lock
CHANGED
|
@@ -304,8 +304,12 @@ Scenario verifies upgrade from previous (major|minor|patch) version to current r
|
|
|
304
304
|
|
|
305
305
|
- Deploys previous (major|minor|patch) version and runs Health Check test suite (Smoke test suite if below 17.1.0)
|
|
306
306
|
to populate data in database before upgrade
|
|
307
|
-
- Generates upgrade path following current GitLab recommendations
|
|
308
|
-
|
|
307
|
+
- Generates upgrade path following current GitLab recommendations.
|
|
308
|
+
The upgrade path is resolved in this order:
|
|
309
|
+
1. `QA_UPGRADE_PATH_FILE` env var — explicit path to a local YAML file.
|
|
310
|
+
2. `$CI_PROJECT_DIR/config/upgrade_path.yml` — set automatically in GitLab CI when running inside a `gitlab-org/gitlab` pipeline.
|
|
311
|
+
3. `../config/upgrade_path.yml` relative to the working directory — covers running from the `qa/` subdirectory of a gitlab checkout.
|
|
312
|
+
4. Remote fetch from [`gitlab.com/gitlab-org/gitlab`](https://gitlab.com/gitlab-org/gitlab/-/raw/master/config/upgrade_path.yml) (fallback when no local file is found).
|
|
309
313
|
- Gradually upgrades GitLab instances to `<current_version>`
|
|
310
314
|
associated with provided `<full image address>` and runs tests against it
|
|
311
315
|
|
data/gitlab-qa.gemspec
CHANGED
|
@@ -16,6 +16,11 @@ Gem::Specification.new do |spec|
|
|
|
16
16
|
spec.homepage = 'http://about.gitlab.com/'
|
|
17
17
|
spec.license = 'MIT'
|
|
18
18
|
|
|
19
|
+
spec.metadata = {
|
|
20
|
+
'source_code_uri' => 'https://gitlab.com/gitlab-org/gitlab-qa',
|
|
21
|
+
'bug_tracker_uri' => 'https://gitlab.com/gitlab-org/gitlab-qa/-/issues'
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
spec.files = `git ls-files -z`
|
|
20
25
|
.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
|
21
26
|
spec.bindir = 'exe'
|
|
@@ -104,7 +104,8 @@ module Gitlab
|
|
|
104
104
|
#
|
|
105
105
|
# @return [String]
|
|
106
106
|
def working_dir_tmp_fixture_path
|
|
107
|
-
|
|
107
|
+
FileUtils.mkdir_p("#{Dir.pwd}/tmp")
|
|
108
|
+
@local_fixture_path ||= Dir.mktmpdir('ldap', "#{Dir.pwd}/tmp")
|
|
108
109
|
end
|
|
109
110
|
|
|
110
111
|
# Copy fixtures to current working directory
|
|
@@ -209,20 +209,82 @@ module Gitlab
|
|
|
209
209
|
UPGRADE_PATH_URL = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/config/upgrade_path.yml"
|
|
210
210
|
UPGRADE_PATH_RETRIES = 3
|
|
211
211
|
UPGRADE_PATH_RETRY_DELAY = 5
|
|
212
|
+
UPGRADE_PATH_RELATIVE_FILE = "config/upgrade_path.yml"
|
|
212
213
|
|
|
213
214
|
# Upgrade path yml
|
|
214
215
|
#
|
|
215
216
|
# @return [String]
|
|
216
217
|
def upgrade_path_yml
|
|
217
|
-
@upgrade_path_yml ||= fetch_upgrade_path_with_retry
|
|
218
|
+
@upgrade_path_yml ||= read_local_upgrade_path || fetch_upgrade_path_with_retry
|
|
218
219
|
end
|
|
219
220
|
|
|
221
|
+
# Attempt to read upgrade_path.yml from a local checkout, trying candidate
|
|
222
|
+
# paths in order:
|
|
223
|
+
# 1. The file pointed to by the QA_UPGRADE_PATH_FILE env var (explicit override).
|
|
224
|
+
# 2. $CI_PROJECT_DIR/config/upgrade_path.yml (set by GitLab CI when gitlab-qa
|
|
225
|
+
# runs inside a gitlab checkout pipeline).
|
|
226
|
+
# 3. ../config/upgrade_path.yml relative to the working directory (gitlab-qa
|
|
227
|
+
# typically runs from the qa/ subdirectory of a gitlab checkout).
|
|
228
|
+
#
|
|
229
|
+
# Returns the file contents as a String when a readable file is found, or nil
|
|
230
|
+
# when none of the candidates exist so the caller can fall back to a remote fetch.
|
|
231
|
+
#
|
|
232
|
+
# @return [String, nil]
|
|
233
|
+
def read_local_upgrade_path
|
|
234
|
+
warn_if_explicit_override_missing
|
|
235
|
+
|
|
236
|
+
candidates = local_upgrade_path_candidates.select { |path| File.file?(path) }
|
|
237
|
+
return if candidates.empty?
|
|
238
|
+
|
|
239
|
+
path = candidates.first
|
|
240
|
+
content = File.read(path)
|
|
241
|
+
|
|
242
|
+
if content.strip.empty?
|
|
243
|
+
logger.warn("Local upgrade path file is empty, falling back to remote fetch: #{path}")
|
|
244
|
+
return
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
logger.info("Reading gitlab upgrade path from local file: #{path}")
|
|
248
|
+
content
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Ordered list of local file path candidates for upgrade_path.yml.
|
|
252
|
+
#
|
|
253
|
+
# @return [Array<String>]
|
|
254
|
+
def local_upgrade_path_candidates
|
|
255
|
+
candidates = []
|
|
256
|
+
candidates << ENV["QA_UPGRADE_PATH_FILE"] if ENV["QA_UPGRADE_PATH_FILE"]
|
|
257
|
+
candidates << File.join(ENV["CI_PROJECT_DIR"], UPGRADE_PATH_RELATIVE_FILE) if ENV["CI_PROJECT_DIR"]
|
|
258
|
+
candidates << File.expand_path(File.join("..", UPGRADE_PATH_RELATIVE_FILE))
|
|
259
|
+
candidates
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Log a warning when QA_UPGRADE_PATH_FILE is explicitly set but does not point
|
|
263
|
+
# to a readable file. A typo'd or stale path would otherwise silently fall
|
|
264
|
+
# through to the CI_PROJECT_DIR / relative-path candidates (or the remote
|
|
265
|
+
# fetch), producing a different upgrade path than the user intended.
|
|
266
|
+
#
|
|
267
|
+
# @return [void]
|
|
268
|
+
def warn_if_explicit_override_missing
|
|
269
|
+
explicit = ENV.fetch("QA_UPGRADE_PATH_FILE", nil)
|
|
270
|
+
return unless explicit
|
|
271
|
+
return if File.file?(explicit)
|
|
272
|
+
|
|
273
|
+
logger.warn("QA_UPGRADE_PATH_FILE is set to '#{explicit}' but the file does not exist; " \
|
|
274
|
+
"falling through to other candidates")
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Fetch upgrade_path.yml from the remote GitLab repository, retrying on
|
|
278
|
+
# transient errors. Raises after UPGRADE_PATH_RETRIES failed attempts.
|
|
279
|
+
#
|
|
280
|
+
# @return [String]
|
|
220
281
|
def fetch_upgrade_path_with_retry
|
|
221
282
|
retries = 0
|
|
283
|
+
headers = upgrade_path_request_headers
|
|
222
284
|
|
|
223
285
|
logger.info("Fetching gitlab upgrade path from 'gitlab.com/gitlab-org/gitlab' project")
|
|
224
286
|
begin
|
|
225
|
-
HttpRequest.make_http_request(url: UPGRADE_PATH_URL).body
|
|
287
|
+
HttpRequest.make_http_request(url: UPGRADE_PATH_URL, headers: headers).body
|
|
226
288
|
rescue StandardError => e
|
|
227
289
|
retries += 1
|
|
228
290
|
if retries <= UPGRADE_PATH_RETRIES
|
|
@@ -234,6 +296,20 @@ module Gitlab
|
|
|
234
296
|
raise "Failed to fetch gitlab upgrade path after #{UPGRADE_PATH_RETRIES} retries: #{e.message}"
|
|
235
297
|
end
|
|
236
298
|
end
|
|
299
|
+
|
|
300
|
+
# Build request headers for the upgrade path HTTP fetch.
|
|
301
|
+
#
|
|
302
|
+
# Includes a User-Agent header when GITLAB_QA_USER_AGENT is set, so the
|
|
303
|
+
# request matches the Cloudflare bypass rule already in place for GitLab QA.
|
|
304
|
+
#
|
|
305
|
+
# @return [Hash]
|
|
306
|
+
def upgrade_path_request_headers
|
|
307
|
+
user_agent = Runtime::Env.gitlab_qa_user_agent.to_s.strip
|
|
308
|
+
return {} if user_agent.empty?
|
|
309
|
+
|
|
310
|
+
logger.info("Using GITLAB_QA_USER_AGENT for upgrade path fetch")
|
|
311
|
+
{ "User-Agent" => user_agent }
|
|
312
|
+
end
|
|
237
313
|
end
|
|
238
314
|
end
|
|
239
315
|
end
|
data/lib/gitlab/qa/version.rb
CHANGED
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: 15.
|
|
4
|
+
version: 15.9.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: 2026-
|
|
11
|
+
date: 2026-09-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -536,7 +536,9 @@ files:
|
|
|
536
536
|
homepage: http://about.gitlab.com/
|
|
537
537
|
licenses:
|
|
538
538
|
- MIT
|
|
539
|
-
metadata:
|
|
539
|
+
metadata:
|
|
540
|
+
source_code_uri: https://gitlab.com/gitlab-org/gitlab-qa
|
|
541
|
+
bug_tracker_uri: https://gitlab.com/gitlab-org/gitlab-qa/-/issues
|
|
540
542
|
post_install_message:
|
|
541
543
|
rdoc_options: []
|
|
542
544
|
require_paths:
|