Skip to content

Use TOP_UPSTREAM_SOURCE_SHA as QA_IMAGE_TAG for gitlab project

John McDonnell requested to merge handle-underscore_in-branch_name into master

What does this MR do and why?

If someone creates a branch with an underscore rather than a hyphen the docker image cannot be found.
e.g. https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/2401675970 However, if you lookup the docker image with a name that replaces all '_' with '-' we can find the image.
We have also had a number of cases where people have created branch names longer than 63 characters long and encountered errors.

See Internal link for details

Given that the docker image is generated using CI_COMMIT_REF_SLUG https://docs.gitlab.com/ee/ci/variables/predefined_variables.html it's clear that there are other potential failing cases that may occur as well if special chars are present in a branch name.

With that in mind this change updates QA_IMAGE_TAG variable to use the TOP_UPSTREAM_SOURCE_SHA to avoid any issues caused by people using branches with complex names.

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 John McDonnell

Merge request reports