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.
  • up checks 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_REF with --gitlab-version is refused, and it is ignored with a log line on the other bases.
  • Instance state records dev_source as <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 --> L

Proof

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.

  • up logged dev source is dev-source-proof at 93cbcca41645 ... gitlab.com is not cloned, then source from ~/dev-source.bundle ... gitlab.com is not asked, then ENV READY.
  • On the VM, ~/work/gitlab is on branch dev-source-proof at Snapshot of dev-source-proof at 93cbcca4164509953da836be4125e7f1c7372693, with no remote and a clean tree. DEV_SOURCE_PROOF_MARKER is in the working tree and reads dev-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.

Merge request reports

Loading
Loading