gitlab-qa 15.7.0 → 15.7.2
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/lib/gitlab/qa/component/base.rb +4 -0
- data/lib/gitlab/qa/release.rb +3 -0
- data/lib/gitlab/qa/scenario/test/integration/geo.rb +3 -1
- data/lib/gitlab/qa/support/gitlab_upgrade_path.rb +22 -5
- data/lib/gitlab/qa/support/gitlab_version_info.rb +157 -3
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e2f5e12b0e4b1d6949c3bf2ac7b988ab0f4b42a1c9e039828da20d0611f0e284
|
|
4
|
+
data.tar.gz: c41f28650cf5a9da55dbe1e97b6c9d4d04f08457e8d19f57982ecf193879603a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afdb8a6544dd8aa320f1b076d16ce0aa6dc453e014f3bf8b7b30fd1b29a2abd0d1d99df34755ae4812e9bc1c83da7d154a7bfdc7a68894a1d2ef71b8bfacc17a
|
|
7
|
+
data.tar.gz: 6ddd0641fe2d3cf5e5f63915854bea06b4fac93ec18d2f6651f85dbd581621aa952741d35575f4ee56b91709c383c2c12318825e8250345857ff16c4930f086a
|
data/Gemfile.lock
CHANGED
data/lib/gitlab/qa/release.rb
CHANGED
|
@@ -154,6 +154,9 @@ module Gitlab
|
|
|
154
154
|
# Case 2: Auto-deploy packages from dev.gitlab.org (e.g., 12.1.201906121026-325a6632895.b340d0bd35d)
|
|
155
155
|
elsif match_data = tag.match(DEV_TAG_REGEX)
|
|
156
156
|
match_data[:gitlab_ref]
|
|
157
|
+
# Case 3: Internal release packages (e.g., 18.7.1-internal2-0)
|
|
158
|
+
elsif tag.match?(/\d+\.\d+\.\d+-internal\d+-0\z/)
|
|
159
|
+
tag.delete_suffix('-0')
|
|
157
160
|
else
|
|
158
161
|
tag.sub(/[-.]([ce]e)(\.(\d+))?\z/, '-\1')
|
|
159
162
|
end
|
|
@@ -42,6 +42,7 @@ module Gitlab
|
|
|
42
42
|
secondary.release = release
|
|
43
43
|
secondary.name = 'gitlab-secondary'
|
|
44
44
|
secondary.network = 'geo'
|
|
45
|
+
secondary.seed_admin_token = false
|
|
45
46
|
secondary.omnibus_configuration << <<~OMNIBUS
|
|
46
47
|
geo_secondary['db_fdw'] = true;
|
|
47
48
|
geo_secondary_role['enable'] = true;
|
|
@@ -57,7 +58,8 @@ module Gitlab
|
|
|
57
58
|
sidekiq['concurrency'] = 2;
|
|
58
59
|
puma['worker_processes'] = 2;
|
|
59
60
|
OMNIBUS
|
|
60
|
-
secondary.
|
|
61
|
+
secondary.add_exec_commands(fast_ssh_key_lookup_commands)
|
|
62
|
+
secondary.add_exec_commands(QA::Scenario::CLICommands.git_lfs_install_commands)
|
|
61
63
|
|
|
62
64
|
secondary.act do
|
|
63
65
|
# TODO, we do not wait for secondary to start because of
|
|
@@ -206,15 +206,32 @@ module Gitlab
|
|
|
206
206
|
.map { |version| Gem::Version.new("#{version[:major]}.#{version[:minor]}") }
|
|
207
207
|
end
|
|
208
208
|
|
|
209
|
+
UPGRADE_PATH_URL = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/config/upgrade_path.yml"
|
|
210
|
+
UPGRADE_PATH_RETRIES = 3
|
|
211
|
+
UPGRADE_PATH_RETRY_DELAY = 5
|
|
212
|
+
|
|
209
213
|
# Upgrade path yml
|
|
210
214
|
#
|
|
211
215
|
# @return [String]
|
|
212
216
|
def upgrade_path_yml
|
|
213
|
-
@upgrade_path_yml ||=
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
@upgrade_path_yml ||= fetch_upgrade_path_with_retry
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
def fetch_upgrade_path_with_retry
|
|
221
|
+
retries = 0
|
|
222
|
+
|
|
223
|
+
logger.info("Fetching gitlab upgrade path from 'gitlab.com/gitlab-org/gitlab' project")
|
|
224
|
+
begin
|
|
225
|
+
HttpRequest.make_http_request(url: UPGRADE_PATH_URL).body
|
|
226
|
+
rescue StandardError => e
|
|
227
|
+
retries += 1
|
|
228
|
+
if retries <= UPGRADE_PATH_RETRIES
|
|
229
|
+
logger.warn("Failed to fetch upgrade path (attempt #{retries}/#{UPGRADE_PATH_RETRIES}): #{e.message}")
|
|
230
|
+
sleep UPGRADE_PATH_RETRY_DELAY
|
|
231
|
+
retry
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
raise "Failed to fetch gitlab upgrade path after #{UPGRADE_PATH_RETRIES} retries: #{e.message}"
|
|
218
235
|
end
|
|
219
236
|
end
|
|
220
237
|
end
|
|
@@ -24,6 +24,15 @@ module Gitlab
|
|
|
24
24
|
# @param [String] semver_component version number component for previous version detection - major|minor|patch
|
|
25
25
|
# @return [Gem::Version]
|
|
26
26
|
def previous_version(semver_component)
|
|
27
|
+
# Check for environment variable override
|
|
28
|
+
override_key = "QA_PREVIOUS_#{semver_component.upcase}_OVERRIDE"
|
|
29
|
+
override_value = ENV.fetch(override_key, nil)
|
|
30
|
+
|
|
31
|
+
if override_value && !override_value.empty?
|
|
32
|
+
logger.info("Using override for previous #{semver_component}: #{override_value}")
|
|
33
|
+
return Gem::Version.new(override_value)
|
|
34
|
+
end
|
|
35
|
+
|
|
27
36
|
case semver_component
|
|
28
37
|
when "major"
|
|
29
38
|
previous_major
|
|
@@ -60,7 +69,10 @@ module Gitlab
|
|
|
60
69
|
# check if version is already a patch version
|
|
61
70
|
return version if version.to_s.split('.').size == 3
|
|
62
71
|
|
|
63
|
-
versions.find { |ver| ver.to_s.match?(/^#{version}\./) }
|
|
72
|
+
result = versions.find { |ver| ver.to_s.match?(/^#{version}\./) }
|
|
73
|
+
result ||= handle_latest_patch_prerelease_fallback(version) if current_version.include?('-pre')
|
|
74
|
+
|
|
75
|
+
result.tap do |ver|
|
|
64
76
|
raise_version_not_found("Latest patch version for version #{version}") unless ver
|
|
65
77
|
end
|
|
66
78
|
end
|
|
@@ -88,6 +100,49 @@ module Gitlab
|
|
|
88
100
|
|
|
89
101
|
private
|
|
90
102
|
|
|
103
|
+
def handle_latest_patch_prerelease_fallback(version)
|
|
104
|
+
return unless version.to_s.match?(/^\d+$/)
|
|
105
|
+
|
|
106
|
+
log_fallback_info("major", version.to_s)
|
|
107
|
+
|
|
108
|
+
fallback_major = version.segments[0] - 1
|
|
109
|
+
return unless fallback_major.positive?
|
|
110
|
+
|
|
111
|
+
result = versions.find { |ver| ver.to_s.match?(/^#{fallback_major}\./) }
|
|
112
|
+
logger.warn("🔄 Using fallback major version: #{result}") if result
|
|
113
|
+
result
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def find_previous_minor_version
|
|
117
|
+
target_minor = current_minor - 1
|
|
118
|
+
result = versions.find { |version| version.to_s.match?(/^#{current_major}\.#{target_minor}/) }
|
|
119
|
+
|
|
120
|
+
return result if result
|
|
121
|
+
return unless current_version.include?('-pre')
|
|
122
|
+
|
|
123
|
+
find_previous_minor_prerelease_fallback(target_minor)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def find_previous_minor_prerelease_fallback(target_minor)
|
|
127
|
+
log_fallback_info("minor", "#{current_major}.#{target_minor}")
|
|
128
|
+
|
|
129
|
+
result = find_fallback_minor_version(target_minor)
|
|
130
|
+
return result if result
|
|
131
|
+
|
|
132
|
+
result = previous_major
|
|
133
|
+
logger.warn("🔄 Falling back to previous major version: #{result}") if result
|
|
134
|
+
result
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def find_fallback_minor_version(target_minor)
|
|
138
|
+
fallback_minor_version = target_minor - 1
|
|
139
|
+
return unless fallback_minor_version >= 0
|
|
140
|
+
|
|
141
|
+
result = versions.find { |version| version.to_s.match?(/^#{current_major}\.#{fallback_minor_version}/) }
|
|
142
|
+
logger.warn("🔄 Using fallback minor version: #{result}") if result
|
|
143
|
+
result
|
|
144
|
+
end
|
|
145
|
+
|
|
91
146
|
MAX_TAGS_HTTP_REQUESTS = 50
|
|
92
147
|
# https://docs.docker.com/docker-hub/api/latest/#tag/images/operation/GetNamespacesRepositoriesImages
|
|
93
148
|
TAGS_PER_PAGE = 100
|
|
@@ -138,7 +193,8 @@ module Gitlab
|
|
|
138
193
|
return fallback_minor unless tags
|
|
139
194
|
return previous_major if current_minor.zero?
|
|
140
195
|
|
|
141
|
-
|
|
196
|
+
result = find_previous_minor_version
|
|
197
|
+
result.tap do |ver|
|
|
142
198
|
raise_version_not_found("Previous minor version for current version #{current_version}") unless ver
|
|
143
199
|
end
|
|
144
200
|
end
|
|
@@ -242,7 +298,105 @@ module Gitlab
|
|
|
242
298
|
end
|
|
243
299
|
|
|
244
300
|
def raise_version_not_found(error_prefix)
|
|
245
|
-
|
|
301
|
+
error_message = build_detailed_error_message(error_prefix)
|
|
302
|
+
raise(VersionNotFoundError, error_message)
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Build a detailed, helpful error message for version not found scenarios
|
|
306
|
+
def build_detailed_error_message(error_prefix)
|
|
307
|
+
separator = "=" * 80
|
|
308
|
+
|
|
309
|
+
message = <<~ERROR
|
|
310
|
+
|
|
311
|
+
#{separator}
|
|
312
|
+
🚨 GITLAB QA VERSION DETECTION ERROR 🚨
|
|
313
|
+
#{separator}
|
|
314
|
+
|
|
315
|
+
#{error_prefix} not available on Dockerhub (yet)
|
|
316
|
+
|
|
317
|
+
CONTEXT:
|
|
318
|
+
• Current version: #{current_version}
|
|
319
|
+
• Looking for: #{describe_missing_version}
|
|
320
|
+
• This typically happens during GitLab's monthly release cycle
|
|
321
|
+
|
|
322
|
+
WHY THIS HAPPENS:
|
|
323
|
+
During the 1-day window between VERSION file updates and actual release:
|
|
324
|
+
1. VERSION file gets updated to next version (e.g., 18.9.0-pre)
|
|
325
|
+
2. Upgrade tests look for previous version (e.g., 18.8.x)
|
|
326
|
+
3. But that version hasn't been released to Docker Hub yet
|
|
327
|
+
|
|
328
|
+
SOLUTIONS:
|
|
329
|
+
1. WAIT: This will resolve automatically after the release (usually within 24 hours)
|
|
330
|
+
2. OVERRIDE: Set environment variable to use a known version:
|
|
331
|
+
#{suggest_override_variable}
|
|
332
|
+
3. SKIP: Temporarily disable these upgrade tests during pre-release periods
|
|
333
|
+
4. VERIFY: Check available versions on Docker Hub:
|
|
334
|
+
https://hub.docker.com/r/gitlab/gitlab-#{edition}/tags
|
|
335
|
+
|
|
336
|
+
MORE INFO:
|
|
337
|
+
• Documentation: https://docs.gitlab.com/ee/development/testing_guide/end_to_end/
|
|
338
|
+
• Release schedule: https://about.gitlab.com/releases/
|
|
339
|
+
• Report issues: https://gitlab.com/gitlab-org/gitlab-qa/-/issues
|
|
340
|
+
|
|
341
|
+
#{separator}
|
|
342
|
+
ERROR
|
|
343
|
+
|
|
344
|
+
message.strip
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# Describe what version we're looking for based on current context
|
|
348
|
+
def describe_missing_version
|
|
349
|
+
if current_version.include?('-pre')
|
|
350
|
+
if current_minor.positive?
|
|
351
|
+
"#{current_major}.#{current_minor - 1}.x versions (previous minor)"
|
|
352
|
+
else
|
|
353
|
+
"#{current_major - 1}.x.x versions (previous major)"
|
|
354
|
+
end
|
|
355
|
+
else
|
|
356
|
+
"Previous version for #{current_version}"
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
# Suggest appropriate override environment variable
|
|
361
|
+
def suggest_override_variable
|
|
362
|
+
if current_version.include?('-pre')
|
|
363
|
+
if current_minor.positive?
|
|
364
|
+
suggested_version = "#{current_major}.#{current_minor - 1}.0"
|
|
365
|
+
"export QA_PREVIOUS_MINOR_OVERRIDE=#{suggested_version}"
|
|
366
|
+
else
|
|
367
|
+
suggested_version = "#{current_major - 1}.12.0"
|
|
368
|
+
"export QA_PREVIOUS_MAJOR_OVERRIDE=#{suggested_version}"
|
|
369
|
+
end
|
|
370
|
+
else
|
|
371
|
+
"export QA_PREVIOUS_MINOR_OVERRIDE=<version>"
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
# Log helpful information when using fallback logic
|
|
376
|
+
def log_fallback_info(upgrade_type, missing_version)
|
|
377
|
+
separator = "-" * 60
|
|
378
|
+
|
|
379
|
+
logger.warn(<<~WARNING.strip)
|
|
380
|
+
#{separator}
|
|
381
|
+
🚨 PRE-RELEASE VERSION FALLBACK ACTIVATED
|
|
382
|
+
#{separator}
|
|
383
|
+
|
|
384
|
+
Target #{upgrade_type} version #{missing_version} not found for pre-release #{current_version}
|
|
385
|
+
|
|
386
|
+
This is NORMAL during GitLab's monthly release cycle!
|
|
387
|
+
|
|
388
|
+
• Reason: #{missing_version} hasn't been released to Docker Hub yet
|
|
389
|
+
• Action: Falling back to older available version
|
|
390
|
+
• Impact: Tests will run against older version (still valid)
|
|
391
|
+
|
|
392
|
+
To override this behavior, set:
|
|
393
|
+
#{suggest_override_variable}
|
|
394
|
+
|
|
395
|
+
Or check available versions:
|
|
396
|
+
https://hub.docker.com/r/gitlab/gitlab-#{edition}/tags
|
|
397
|
+
|
|
398
|
+
#{separator}
|
|
399
|
+
WARNING
|
|
246
400
|
end
|
|
247
401
|
end
|
|
248
402
|
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.7.
|
|
4
|
+
version: 15.7.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:
|
|
11
|
+
date: 2026-04-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|