Use the (merge) commit sha when building CNG components
What does this MR do?
- The assets cache image is built against the merge commit (aka
$CI_COMMIT_SHA
): https://gitlab.com/gitlab-org/gitlab/-/blob/db839bf23e216b43e8b920265d7dc814a9365cc9/.gitlab/ci/frontend.gitlab-ci.yml#L58-63 - The CNG images are built against the branch: https://gitlab.com/gitlab-org/gitlab/-/blob/db839bf23e216b43e8b920265d7dc814a9365cc9/scripts/trigger-build#L181
- The problem is that the branch
HEAD
commit isn't the same as the merge commit, thus assets in the assets image have a high chance of having a different hash than the actual assets that would be generated from the branchHEAD
. - The correct assets are the ones generated from the merge commit, so
we're changing the CNG trigger variables to pass
GITLAB_VERSION=$CI_COMMIT_SHA
instead ofGITLAB_VERSION=$CI_COMMIT_REF_NAME
so that the components are built from the same commit as the assets image.
Does this MR meet the acceptance criteria?
Conformity
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Separation of EE specific content
Closes #202651 (closed).
Edited by Rémy Coutable