Skip to content

Ensure auto-build-image and auto-deploy-image exist

Hordur Freyr Yngvason requested to merge ensure-ado-images-exist into master

What does this MR do and why?

auto-build-image and auto-deploy-image are automatically released on git tags, but sometimes the release pipeline fails. Renovate watches git tags when creating update MRs for these versions, so it's possible for it to create MRs for images that have yet to be published.

This highlighted low hanging fruit for a smoke test: Ensure the image in the template exists.

(We also want to make the image release pipelines more reliable, but this is good to have regardless)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

In a rails console, you can test that the newly added helpers behave as expected:

load 'spec/support/webmock.rb'
load 'spec/support/helpers/ci/template_helpers.rb'
include Ci::TemplateHelpers

public_image_exist?('https://registry.gitlab.com', 'gitlab-org/cluster-integration/auto-deploy-image', 'v1.0.0')
# => true

public_image_exist?('https://registry.gitlab.com', 'gitlab-org/cluster-integration/auto-deploy-image', 'does-not-exist')
# => false

# It also works on other registries. For example, testing the `busybox` image repository:

public_image_exist?('https://registry.hub.docker.com', 'library/busybox', 'latest')
# => true

public_image_exist?('https://registry.hub.docker.com', 'library/busybox', 'does-not-exist')
# => false

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hordur Freyr Yngvason

Merge request reports

Loading