Skip to content

feat(git): serve exact-commit snapshots for CI - #426

Draft
joshfriend wants to merge 1 commit into
mainfrom
jfriend/sha-snapshots
Draft

joshfriend wants to merge 1 commit into
mainfrom
jfriend/sha-snapshots

Conversation

@joshfriend

Copy link
Copy Markdown
Contributor

CI needs to restore one specific commit on thousands of workers, and today Cachew only snapshots the default branch head. This adds an immutable snapshot per commit SHA at /git/{host}/{repo}/snapshots/v1/{sha}.tar.zst, holding a depth-one detached checkout with its LFS files already materialized.

cachew git prepare <repo> --sha <sha> builds it once before workers fan out, and cachew git restore <repo> <dir> --sha <sha> restores it with no bundle or freshen step, so a hit never touches GitHub or the LFS upstream. The restore verifies the served and extracted commit before moving the checkout into place.

This differs from #415, which snapshots branch tips that move. Known gaps before this can carry CI scale: builds are only deduplicated within a replica, each replica builds one SHA at a time, every SHA is a full checkout rather than a delta from a base snapshot, and all bytes still flow through Cachew.

CI workers need one specific commit, not the default branch head, and should not have to freshen from GitHub on a cache hit.
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