Retrieve all Docker image tags
What does this MR do and why?
Previously GitlabVersionInfo
would attempt to retrieve 1000 tags in
one request, but a max per_page
of 100 is allowed
(https://docs.docker.com/docker-hub/api/latest/#tag/images/operation/GetNamespacesRepositoriesImagesTags).
As a result, only the 100 newest tags were actually loaded, but if an
older GitLab pipeline, such as on the 15-11-stable-ee
branch, the
upgrade path would fail since GitLab v14 was not loaded.
This commit fixes the problem by making multiple calls to iterate through each page number. Limit the number of HTTP requests to 50 to avoid an infinite loop.
Closes #716 (closed)
How to set up and validate locally
- Run this script:
require_relative 'lib/gitlab/qa'
Gitlab::QA::Support::GitlabUpgradePath.new("15.11.0", "major", "ee").fetch
- You should see something like:
irb(main):002:0> Gitlab::QA::Support::GitlabUpgradePath.new("15.11.0", "major", "ee").fetch
[Jul 25 2023 21:25:00 PDT (Gitlab QA)] INFO -- Fetching gitlab upgrade path from 'gitlab-com/support/toolbox/upgrade-path' project
[Jul 25 2023 21:25:01 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 1 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:02 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 2 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:02 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 3 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:03 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 4 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:03 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 5 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:04 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 6 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:04 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 7 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:04 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 8 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:05 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 9 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:05 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 10 from 'gitlab/gitlab-ee' registry
[Jul 25 2023 21:25:06 PDT (Gitlab QA)] INFO -- Fetching Docker tags page 11 from 'gitlab/gitlab-ee' registry
=>
[#<Gitlab::QA::Release:0x0000000109108100 @release="gitlab/gitlab-ee:14.0.0-ee.0">,
#<Gitlab::QA::Release:0x0000000109183d78 @release="gitlab/gitlab-ee:14.3.6-ee.0">,
#<Gitlab::QA::Release:0x0000000109211da8 @release="gitlab/gitlab-ee:14.9.5-ee.0">,
#<Gitlab::QA::Release:0x000000010960bc88 @release="gitlab/gitlab-ee:14.10.5-ee.0">,
#<Gitlab::QA::Release:0x0000000109612060 @release="gitlab/gitlab-ee:15.0.5-ee.0">,
#<Gitlab::QA::Release:0x00000001089972e0 @release="gitlab/gitlab-ee:15.4.6-ee.0">]
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.