Repository navigation
A checkout fetch from a shallow mirror records its head - #2017
Merged
zlareb1 merged 2 commits intoDec 2, 2026
Merged
Conversation
A mirror cloned from a remote that serves truncated history is shallow. A fetch from it into a compiler-tier checkout warns "rejected refs/loom/scip-head because shallow roots are not allowed to be updated", exits 0 and records no ref, so every later fetch has nothing to negotiate from and sends the whole pack again. `--update-shallow` lets the checkout take the mirror's shallow roots; against a full mirror it changes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
The shallow-mirror test checked that the ref was written but not what the ref is for. After two new commits the second fetch must send about three objects per commit, as in the full-mirror test, not the history. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kaloyan Naumov <knaumov@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
approved these changes
Dec 2, 2026
zlareb1
left a comment
Member
There was a problem hiding this comment.
The shared checkout fetch records the target ref for both shallow and full mirrors. The focused fetch tests passed both negotiation cases. The two foreign-owner cases skipped on this Git build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #2016
TL;DR: A compiler-tier checkout fetch from a shallow mirror dropped
refs/loom/scip-headwith a warning and exit 0, so every pass fetched the whole pack again.checkout_fetch_argsnow passes--update-shallow, and the fetch records the ref; against a full mirror the flag changes nothing.Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The compiler tiers record their checkout's fetched head when the repository's remote serves truncated (shallow) history, so later passes fetch only new commits instead of the whole pack.
Why
clone_mirrorclones without a depth, but a remote that serves truncated history makes the mirror shallow anyway. The checkout fetch then has to add shallow roots to a checkout that has none, andgit fetchrefuses that ref update unless it gets--update-shallow: it printsrejected refs/loom/scip-head because shallow roots are not allowed to be updatedand exits 0.compiler_tier.gitonly sees the exit code, so the pass continues with no ref recorded, and the next fetch has nothing to negotiate from. On a 13.7 GB pack that is a full transfer per pass.--update-shallowlets the checkout take the mirror's shallow roots, which is the history the mirror holds.Scope and risk
One argument in
checkout_fetch_args, which all five checkout fetches use (scip_delta,scip_go_delta,scip_ts_delta,scip_py_delta,scip_full.move_checkout). It is inserted after--recurse-submodules=no, so the workers' tests that check the leading arguments are unchanged.clone_mirror(a shallow mirror is what the remote serves), the 600 s limit on the delta workers' fetch (Delta workers fetch the compiler-tier checkout under a hard-coded 600 s limit #2012, PR Delta workers fetch the compiler-tier checkout undercode_git_fetch_timeout_s#2013), and the checkout'sgit checkout --force. No check was added for a ref missing after a fetch that exits 0: with this flag the shallow-root refusal is the only cause of that state that this fetch can meet.Compatibility, rollout and rollback
.git/shallow, which a later fetch without the flag accepts.Tests
tests/unit/test_scip_checkout_fetch_ref.py::test_a_fetch_from_a_shallow_mirror_lands_on_the_refbuilds a real shallow chain in a temporary directory: a five-commit source, a--depth 2bare remote, a mirror cloned from it withgit clone --bare --no-localasclone_mirrordoes (asserted shallow), and an emptygit initcheckout. It fetches the mirror head withcheckout_fetch_argsand assertsrefs/loom/scip-head, then pushes two commits to the mirror, fetches again and asserts the new head and that the fetch brought in at most six objects (commit, tree and blob per commit), as the full-mirror test does, so a fetch that re-sent the history fails.Before the change it fails at the first assertion, while the fetch itself exits 0:
After it, it passes. Focused run over the touched test file and the tests that reach
checkout_fetch_args:The one failure,
test_repo_job_sandbox.py::test_the_relay_is_given_the_live_idle_timeout, isAttributeError: module 'os' has no attribute 'memfd_create'from the local Python build; it does not touch the fetch.ruff check,ruff format --check,scripts/gates/function_length_gate.pyandscripts/gates/mypy_gate.pypass.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code wrote the change and the test. The linked issue carries a plain-git reproduction of the dropped ref, and the red and green runs are in Tests above.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.main; no merged migration is edited. (No migration.)frontend/changed. (Not changed.)docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
Low Risk
Single Git flag on shared checkout fetch args; full mirrors are unchanged, and behavior only fixes shallow-remote edge cases.
Overview
Fixes compiler-tier checkout fetches against shallow mirrors (when the upstream serves truncated history) so
refs/loom/scip-headis actually updated instead of being silently rejected whilegit fetchstill exits 0.checkout_fetch_argsnow passes--update-shallow, allowing the checkout to adopt the mirror’s shallow roots when recording the fetched target. Without it, subsequent passes had nothing to negotiate from and could re-download huge packs every run.A new unit test builds a shallow mirror chain and asserts the ref is set on first fetch and updated incrementally on the next.
Reviewed by Cursor Bugbot for commit 609dbce. Bugbot is set up for automated code reviews on this repo. Configure here.