unseen: revert the batched-blob materialize (it failed git fetch on ~half of repos)

Git.materialize enumerated every object reachable from HEAD and tried to
`git fetch --no-filter` them by SHA. Git rejects that for real repos
("did not send all necessary objects" / "bad revision"), exiting 1 ->
InstrumentFailure(git_exit_1) that failed the whole repository. Measured
in a live draw: 326/670 attempts, ~49% of all failures, which froze the
accepted pool at 44/300. Reproduced on pallets/flask (26221 reachable,
9287 missing, fetch exit 1).

Git cannot batch-fetch arbitrary tree/blob objects by SHA, so remove
materialize and restore the original lazy path: the blob:none clone keeps
the commit graph and the introducing/blame/ordinary-history reads fetch
their blobs on demand through Git's promisor. The per-fix tolerant fetch
loop, the process-pool parallelism, the 25-with-zero-entries guard, the
per-repo deadline and resume are unchanged. Extraction content is
byte-identical (only the prefetch is gone).

217 unseen tests pass, ruff clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-10 05:06:24 +02:00
co-authored by Claude Opus 4.8
parent 40bfdb8e18
commit 0023f61ff8
4 changed files with 22 additions and 98 deletions
+1 -7
View File
@@ -553,9 +553,6 @@ def test_repository_changes_excludes_all_advisory_sites(monkeypatch):
return "app.py\n"
return args[-1] if args[0] == "rev-parse" else ""
def materialize(self, revisions):
assert revisions == ["HEAD", "a" * 40, "d" * 40]
def blob(self, revision, path):
return "def handler():\n return 1\n"
@@ -615,9 +612,6 @@ def test_repository_extra_fixes_are_best_effort(tmp_path, monkeypatch, stage):
return subprocess.CompletedProcess(argv, 1, b"", b"unavailable ref")
if operation == "rev-parse":
output = ref + "\n"
elif operation == "rev-list" and "--objects" in args:
assert kwargs["input"] == ("\n".join(["HEAD", *resolved]) + "\n").encode()
output = ""
elif operation == "rev-list":
assert ref in resolved
output = f"{ref} {candidate.parent}\n"
@@ -658,7 +652,7 @@ def test_repository_extra_fixes_are_best_effort(tmp_path, monkeypatch, stage):
fetches = [args for args, _ in commands if args[0] == "fetch"]
assert [args[-1] for args in fetches] == [candidate.fix, missing, available]
assert all("--no-tags" in args for args in fetches[1:])
assert sum("--objects" in args for args, _ in commands) == 1
assert not any("--objects" in args for args, _ in commands)
if stage == "extra_fetch":
assert not any(args == ["rev-parse", missing] for args, _ in commands)