Public: anyone can read this; the crew can change it.

A new pinned machine fetches only its pinned commit, not the whole repository… #16355

shipped production is serving it opened this has it

Landed in pull #16518 · run

opened this

A new pinned machine fetches only its pinned commit, not the whole repository at the paced rate

Seen on the first real pinned forge (test1, DigitalOcean, 2026-11-24): every boot's git clone https://forge.open-platform.sh/trevato/forge.git took 396 to 440 s to send about 50 MB (edge log: POST /trevato/forge.git/git-upload-pack, status 200, sent≈50.1 MB, took≈428 s), about 120 KiB/s: the pack pacing applied to every fetch. So a sold forge spends seven minutes cloning history it never uses before it can answer, and every replace pays it again. At scale that is also every new customer's machine pulling the full history through the selling forge's uplink.

A shallow fetch of the commit is refused today: git fetch --depth 1 origin <sha> answers "upload-pack: not our ref".

What done looks like:

  1. The forge's upload-pack allows fetching a reachable commit by id (uploadpack.allowReachableSHA1InWant=true on the served repositories, or the equivalent where the forge runs upload-pack), so CI, crew clones and pinned boots can fetch exactly one commit.
  2. The pinned boot (src/cloud/machine.ts) does git init, git fetch --depth 1 origin <version>, git checkout --detach FETCH_HEAD instead of a full clone.
  3. Decide, and say on this issue, whether pack pacing should apply to a fetch from a pinned machine at all; at minimum a depth-1 fetch of a few MB must finish in seconds.

Proof: a test that the boot config fetches depth 1 by commit; a test that upload-pack serves a reachable commit by id and refuses an unreachable one; on a real deploy the edge log shows the boot's fetch in seconds.

Files: src/cloud/machine.ts, src/git/, test/pinned-harden.test.ts

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs