Skip to content

Make git-lfs tar checksum usage coherent

Pedro Pombeiro requested to merge 26554-fix-git-lfs-checksum-usage into master

What does this MR do?

  • Renames identifiers so that they refer to the actual platform:
    • Renames GIT_LFS_256_CHECKSUM to GIT_LFS_AMD64_CHECKSUM
    • Renames GIT_256_CHECKSUM to GIT_AMD64_CHECKSUM
    • Renames PWSH_256_CHECKSUM to PWSH_WINDOWS_AMD64_CHECKSUM
  • 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 with sha256sum.
  • GIT_LFS_256_CHECKSUM is another value that is used for the prepare 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: rename GIT_LFS_256_CHECKSUM to GIT_LFS_AMD64_CHECKSUM, move the checksums to a helper job and just remove the variable definition from the prepare 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

Merge request reports

Loading