gitlab-qa 15.7.0 → 15.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c15ce3f10ca0b06c96ca963f5b18e4935dd1d08633849ff50b13f988786b4fbb
4
- data.tar.gz: 3285a7abf021446299d6ea709cc7086a2a16bc255d983d3e636ed960e342c24f
3
+ metadata.gz: 283e2b2d77e4f2a18d03c454e268b88d4bcaba6662086efe37f2045fd5a2efca
4
+ data.tar.gz: a7ca80f1ba2e9244c7b6046d47e5b154278fe062774583e8874f1da6956890e7
5
5
  SHA512:
6
- metadata.gz: ed753464020cb944a4c66ed615987b955328e15661f49bae683361340f4df24bb19fcd662f179f6fdb27262c285ddb94ef4a81fb570fdcffac789654808c4e22
7
- data.tar.gz: 0bc7581958bcb90509cd05ec5afd2c5fb1f499af131608f145da7e8490d9b607041b4a8cc4d86ade69f1bfb97d73ef4308032c31b717c09d08b881eab6eeef22
6
+ metadata.gz: 77c08d80779857be0baf10a0e1690d8c96e6c107a467f7005ec1f4714ffda321e54a1bab4713a79e52570d9403e8bde33ba7b9b74c135d009a2df590cc904322
7
+ data.tar.gz: b70bc89223d607c828ecacc91b3d433f9a38a420929ca95a97d0a6574618c921e457ca58164353b30574e3a6eb7165cc3a4a6623e45d6672ef178b0a0bc795e6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (15.7.0)
4
+ gitlab-qa (15.7.1)
5
5
  activesupport (>= 6.1, < 8)
6
6
  ffi (~> 1.17)
7
7
  gitlab (~> 4.19)
@@ -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}\./) }.tap do |ver|
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
- versions.find { |version| version.to_s.match?(/^#{current_major}\.#{current_minor - 1}/) }.tap do |ver|
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
- raise(VersionNotFoundError, "#{error_prefix} not available on Dockerhub (yet)")
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '15.7.0'
5
+ VERSION = '15.7.1'
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: 15.7.0
4
+ version: 15.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-18 00:00:00.000000000 Z
11
+ date: 2026-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control