Let the dev base take its source from a local checkout
DEV_SOURCE_REF=<ref> just lab up --base dev runs a ref of a local gitlab checkout instead of cloning gitlab.com.
During the 2026-11-11 gitlab.com load-shed a dev rig stalled about 20 minutes on repeated clone failures, and a rig that needed a local branch had to apply a diff onto the default branch rather than run the tree under test.
How
up builds a git bundle of the ref, copies it with the engine's own scp, and the bootstrap fetches it where it would clone. DEV_SOURCE_REPO=<path> names the checkout when up is not run inside it; just lab defaults it to the invoking directory.
- A shallow clone cannot bundle its parents, so the bundle holds the ref's tree as one commit; a full clone keeps its history.
upchecks the ref and its objects on the laptop first. A missing ref, or a partial clone lacking objects, stops it before a VM exists, and nothing is fetched from gitlab.com.DEV_SOURCE_REFwith--gitlab-versionis refused, and it is ignored with a log line on the other bases.- Instance state records
dev_sourceas<ref>@<commit>. - Unset, the bootstrap clones as before; the clone loop and archive fallback are untouched.
flowchart TD
A["just lab up --base dev"] --> B{"DEV_SOURCE_REF set?"}
B -- "no" --> C["VM clones gitlab.com, depth 1"]
C -- "shed" --> D["retry 20 times"]
D -- "exhausted" --> E["archive tarball from gitlab.com"]
B -- "yes" --> F["check the ref and its objects on the laptop"]
F -- "missing or not a commit" --> G["up stops, no VM created"]
F -- "ok" --> H["git bundle of the ref"]
H --> I["scp to the VM"]
I --> J["bootstrap fetches the bundle"]
J -- "unreadable" --> K["bootstrap stops"]
C --> L["same bootstrap steps: image, postgres, bundle install"]
E --> L
J --> LProof
Override set, on a dev rig from a shallow laptop checkout: a branch dev-source-proof carrying one marker commit that adds DEV_SOURCE_PROOF_MARKER.
uploggeddev source is dev-source-proof at 93cbcca41645 ... gitlab.com is not cloned, thensource from ~/dev-source.bundle ... gitlab.com is not asked, thenENV READY.- On the VM,
~/work/gitlabis on branchdev-source-proofatSnapshot of dev-source-proof at 93cbcca4164509953da836be4125e7f1c7372693, with no remote and a clean tree.DEV_SOURCE_PROOF_MARKERis in the working tree and readsdev-source-proof 2026-11-12T02:13:16Z. - State read
phase: ready,failed_step: null,dev_source: dev-source-proof@93cbcca4164509953da836be4125e7f1c7372693.
Override unset: not run on a second rig. The else branch of the bootstrap differs from main only in indentation (git diff -w), and the engine self-test checks that an unset up passes no DEV_SOURCE_BUNDLE and copies no bundle.
The self-test also covers a full clone (history kept), a shallow clone (one commit), a missing ref, a bad ref name, the --gitlab-version refusal, and that the laptop keeps no refs/dev-source afterwards.
The skill's word budget has about 20 words of headroom, so dev-base.md carries one sentence; the rest is in the lab.just doc comment and the usage text.