external modules: a pin on the remote's default branch name never advances past the clone-time commit #60
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while checking the
rev-parseguard in #40 against a running git, confirmed pre-existing by that PR's sixth review (same result on4e8defband on the branch head;--no-checkoutneither causes nor changes it).What happens
OPSDECK_EXTERNAL_MODULES=…/mod.git#main, wheremainis also the remote's default branch.git clonecreates a local branchmain;checkoutConfiguredReftries the ref as given first, socheckout --detach mainresolves to that local branch — andfetch --tags originonly ever movesorigin/main. The local branch is never updated by anything, so every boot checks out the same commit the first clone landed on:The module never fails and nothing is logged — it simply runs the version it was first cloned at, forever, until the work tree is removed by hand or by a recovery. The unpinned case (
refempty) is unaffected: it goes throughremoteDefaultBranch()and checks outorigin/<default>.Why it wasn't fixed in #40
That PR is six rounds deep on a different fault, and the fix has a semantics question of its own rather than being mechanical:
origin/<ref>first and it is correct for branches, but a branch shadows a tag of the same name — a deployment pinned to tagv2on a repo that also has a branchv2silently changes meaning.refs/tags/<ref>probe before the branch attempt, which is a third round-trip on the pre-Deno.servepath.Either way the resolution order becomes part of the configured-ref contract and wants documenting in
docs/modules.md, plus a test per shape: branch, tag, sha, and the branch-and-tag-of-one-name collision.Note for whoever takes it:
checkoutConfiguredRefnow makes its second (origin/<ref>) attempt only whenrev-parse --verify --quiet origin/<ref>^{commit}says there is such a branch, so the probe this fix needs is already half there.Source: #40 (comment) ("Found on the way, not fixed here"), confirmed in the review at #40 round 6.