Make git-lfs tar checksum usage coherent
What does this MR do?
- Renames identifiers so that they refer to the actual platform:
- Renames
GIT_LFS_256_CHECKSUM
toGIT_LFS_AMD64_CHECKSUM
- Renames
GIT_256_CHECKSUM
toGIT_AMD64_CHECKSUM
- Renames
PWSH_256_CHECKSUM
toPWSH_WINDOWS_AMD64_CHECKSUM
- Renames
- Makes
GIT_LFS_*_CHECKSUM
refer to the checksum of the download listed in https://github.com/git-lfs/git-lfs/releases instead of the one from the final binary (easier to update in the future). - Introduces
.linux-dependency-checksums
and.windows-dependency-checksums
helper jobs to contain all the checksums for reuse.
Why was this MR needed?
While updating the git lfs version I noticed a couple of things that hindered me, so we might want to improve on them for the future:
-
GIT_LFS_*_CHECKSUM
values refer to the binary inside the .tar.gz file we download from the project repo. It would be much easier to check the SHA256 of the .tar.gz we download from the GitHub repo, since those are described in the release page (under the SHA-256 hashes section). Currently, we need to manually download the archive, unzip it, and compute withsha256sum
. -
GIT_LFS_256_CHECKSUM
is another value that is used for theprepare ci image
job. This one uses the approach I suggest in the point above though, so there is inconsistency. I’d propose one change here though: renameGIT_LFS_256_CHECKSUM
toGIT_LFS_AMD64_CHECKSUM
, move the checksums to a helper job and just remove the variable definition from theprepare ci image
job.
What's the best way to test this MR?
The CI build should be green. The resulting Docker helper and CI images should still contain the right version of Git, Git LFS, and Powershell Core.
Tested a random image:
$ wget https://gitlab-runner-downloads.s3.amazonaws.com/26554-fix-git-lfs-checksum-usage/helper-images/prebuilt-alpine-x86_64-pwsh.tar.xz && \
docker import prebuilt-alpine-x86_64-pwsh.tar.xz gitlab/gitlab-runner-helper:x86_64-alpine-466d4030-pwsh && \
docker run gitlab/gitlab-runner-helper:x86_64-alpine-466d4030-pwsh bash -c 'pwsh --version && git --version && git lfs --version'
PowerShell 7.1.1
git version 2.26.3
git-lfs/2.11.0 (GitHub; linux amd64; go 1.13.11; git fceccfb7bd)
$ wget https://gitlab-runner-downloads.s3.amazonaws.com/26554-fix-git-lfs-checksum-usage/helper-images/prebuilt-ubuntu-x86_64-pwsh.tar.xz && \
docker import prebuilt-alpine-x86_64-pwsh.tar.xz gitlab/gitlab-runner-helper:x86_64-ubuntu-466d4030-pwsh && \
docker run gitlab/gitlab-runner-helper:x86_64-ubuntu-466d4030-pwsh bash -c 'pwsh --version && git --version && git lfs --version'
PowerShell 7.1.1
git version 2.26.3
git-lfs/2.11.0 (GitHub; linux amd64; go 1.13.11; git fceccfb7bd)
What are the relevant issue numbers?
Closes #26554 (closed)
Edited by Pedro Pombeiro