Skip to content

feat(git): serve snapshots of non-default branches - #415

Draft
luispadron wants to merge 1 commit into
mainfrom
luis/snapshot-ref
Draft

luispadron wants to merge 1 commit into
mainfrom
luis/snapshot-ref

Conversation

@luispadron

Copy link
Copy Markdown
Contributor

Clients can request a working-tree snapshot of a branch other than the default with snapshot.tar.zst?ref=<branch>.

  • A branch snapshot is built in the background on its first request (that request gets a 404, so clients fall back to the default snapshot). It refreshes on snapshot-interval while requested and is dropped after branch-snapshot-idle-timeout or when the branch is deleted.
  • branch-snapshot-max-refs caps branches per repo, evicting the least recently requested. It defaults to 0, so the feature is off unless configured.
  • The delta bundle and LFS snapshot endpoints accept the same ref parameter; the advertised bundle URL carries it.
  • Generation reuses the existing snapshot coordinator, keyed per branch, so replicas don't duplicate builds.
  • The client gains a WithRef option on OpenGitSnapshot, OpenGitSnapshotParallel, and OpenGitLFSSnapshot.

Default-branch snapshot keys and behaviour are unchanged.

Snapshot, bundle, and LFS endpoints accept ?ref=<branch>. A branch snapshot
is built on its first request, refreshed while requested, and dropped when
idle or deleted. Capped per repo by branch-snapshot-max-refs (off by default).
The client gains a WithRef option.
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