gitlab-qa 12.1.0 → 12.2.1

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: afdb9bf3f2ac72d0c781f6d41453c850006761d74a7e3cc7a753b56e07b3bc71
4
- data.tar.gz: 1c87b39985c2a7816f5710eaefa5721bfcf21aed14c66eddd44fa95756eed809
3
+ metadata.gz: d415adc65e11bf7cb6e51536436a6569e8477bb37cb16ef6834148e1966b3a97
4
+ data.tar.gz: 18bb3333e27085779c061807124eef6921cb9e272d1bbca9f36f4c5b8fc1e703
5
5
  SHA512:
6
- metadata.gz: 7ec5fea822ba19ff238f741d8b1f9a1ad029ace4334f8dc75a0e8b89f1b231e30fec44bf9dc91c880cac048fc63ebf86b0c85223bf9245ebbcc363c8d87e61be
7
- data.tar.gz: 9e94728737df591d9aea64471ba3d2ac0a63c25f007405441b345b87814d4d0c6db5335851406ec5a97de71e3c9ffadf6255f4dfcafccd0ff9cde6b6182db576
6
+ metadata.gz: a3af2c133956e35c0fc594811d9027a0a61798407632c790dbefb7873605db3701ec56c0b7c7f2dc046ea4b0f711b15a40d8bb746b15c2f0d285b8bb942b7a1a
7
+ data.tar.gz: f188e6ea775ecc41d6e31de86a609a2ce479ab52055cb28f9e3c6c08feeea8d549494e578dd3c09daa46e659a654fed1ef464ab465a67033b0b7ecb6f211f9c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (12.1.0)
4
+ gitlab-qa (12.2.1)
5
5
  activesupport (>= 6.1, < 7.1)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
@@ -147,6 +147,7 @@ module Gitlab
147
147
  gitlab_rails['rake_cache_clear'] = false;
148
148
  gitlab_rails['auto_migrate'] = false;
149
149
  gitlab_exporter['enable'] = false;
150
+ gitlab_kas['enable'] = false;
150
151
  OMNIBUS
151
152
  end
152
153
  end
@@ -47,6 +47,10 @@ module Gitlab
47
47
 
48
48
  private
49
49
 
50
+ MAX_TAGS_HTTP_REQUESTS = 50
51
+ # https://docs.docker.com/docker-hub/api/latest/#tag/images/operation/GetNamespacesRepositoriesImages
52
+ TAGS_PER_PAGE = 100
53
+
50
54
  attr_reader :current_version, :edition, :logger
51
55
 
52
56
  # Current versions major version
@@ -158,22 +162,40 @@ module Gitlab
158
162
  def tags
159
163
  return @tags if defined?(@tags)
160
164
 
161
- logger.info("Fetching docker tags from 'gitlab/gitlab-#{edition}' registry")
165
+ MAX_TAGS_HTTP_REQUESTS.times do |index|
166
+ tag_list, more_data = fetch_tags(page: index + 1)
167
+
168
+ if tag_list
169
+ @tags = Array(@tags)
170
+ @tags += tag_list
171
+ end
172
+
173
+ break if tag_list.nil? || more_data.nil?
174
+ end
175
+
176
+ @tags
177
+ end
178
+
179
+ def fetch_tags(page:, per_page: TAGS_PER_PAGE)
180
+ logger.info("Fetching Docker tags page #{page} from 'gitlab/gitlab-#{edition}' registry")
162
181
  response = HttpRequest.make_http_request(
163
- url: "https://registry.hub.docker.com/v2/namespaces/gitlab/repositories/gitlab-#{edition}/tags?page_size=1000",
182
+ url: "https://registry.hub.docker.com/v2/namespaces/gitlab/repositories/gitlab-#{edition}/tags?page=#{page}&page_size=#{per_page}",
164
183
  fail_on_error: false
165
184
  )
166
185
 
167
186
  unless response.code == 200
168
187
  logger.error(" failed to fetch docker tags - code: #{response.code}, response: '#{response.body}'")
169
- return @tags = nil
188
+ return nil
170
189
  end
171
190
 
172
- @tags = JSON
173
- .parse(response.body, symbolize_names: true)
191
+ response = JSON.parse(response.body, symbolize_names: true)
192
+ matching_tags = response
174
193
  .fetch(:results)
175
194
  .map { |tag| tag[:name] }
176
195
  .grep(VERSION_PATTERN)
196
+ more_data = response.fetch(:next)
197
+
198
+ [matching_tags, more_data]
177
199
  end
178
200
  end
179
201
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '12.1.0'
5
+ VERSION = '12.2.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: 12.1.0
4
+ version: 12.2.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: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control