Skip to content

[WIP] feat(git-init): add -lfs flag to pull Git LFS objects (DEVOPS-44388) - #23

Draft
l-qing wants to merge 1 commit into
alauda-v1.1.0from
feat/devops-44388-git-clone-lfs
Draft

[WIP] feat(git-init): add -lfs flag to pull Git LFS objects (DEVOPS-44388)#23
l-qing wants to merge 1 commit into
alauda-v1.1.0from
feat/devops-44388-git-clone-lfs

Conversation

@l-qing

@l-qing l-qing commented Jun 25, 2026

Copy link
Copy Markdown

Status: WIP / incomplete — opened as a reference for the next implementation of DEVOPS-44388. NOT ready to merge.

What this does

Adds opt-in Git LFS support to git-init so the git-clone Task can materialise LFS-tracked files into their real content instead of leaving LFS pointer files in the working tree.

  • New -lfs flag (default false) in main.go.
  • FetchSpec.LFS + lfsFetch() in git/git.go: after checkout (including submodules), run git lfs install --local then git lfs pull, reusing the already-configured origin, credentials and proxy settings.

Verified locally

  • go vet / go build / existing unit tests all green.
  • Integration test against a real LFS repository: with -lfs=true the working tree gets the real object content (sha256 matches the source), exit 0; with -lfs=false (default) the file stays an LFS pointer — behaviour byte-for-byte unchanged.
  • The base image cgr.dev/chainguard/git already ships git-lfs (3.7.1), so no base-image change is required.

NOT done yet (why this is WIP)

  • No repo-level unit test added for the LFS path (git/git_test.go) — only an external integration test was run.
  • git-init image not yet rebuilt / published with this code.
  • No cluster e2e run.

Rollout ordering (important)

The git-init image must be rebuilt and published first; only then can the catalog git-clone Task's lfs=true work in-cluster. Passing -lfs to an image that predates this flag fails (Go's flag parser exits non-zero). The companion Task change already guards against this by only appending -lfs when explicitly enabled.

Context

  • Companion Task wiring PR (catalog git-clone Task): tracked in the Jira ticket below.
  • Jira: DEVOPS-44388

Add an opt-in -lfs flag (default false). When enabled, after the checkout
and submodule update, run `git lfs install --local` and `git lfs pull` so
LFS-tracked files are materialised into real content instead of pointer
files, reusing the already-configured origin, credentials and proxy.

Refs: DEVOPS-44388
@l-qing

l-qing commented Jun 25, 2026

Copy link
Copy Markdown
Author

Companion Task wiring PR: AlaudaDevops/catalog#1031 · Jira: DEVOPS-44388 (https://jira.alauda.cn/browse/DEVOPS-44388). WIP/reference only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant