Skip to content

A compiler tier syncs submodule URLs before it fetches their pins, so a submodule moved to another remote is fetched from it - #2080

Open
zlareb1 wants to merge 6 commits into
mainfrom
fix/submodule-url-sync
Open

zlareb1 wants to merge 6 commits into
mainfrom
fix/submodule-url-sync

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in a release)

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):

A C++ compiler tier no longer stops at a submodule the repository moved to another remote: each pass syncs the submodule URLs from the commit's .gitmodules before it fetches their pins.

Why

The C++ tier keeps one checkout per entry and moves it from commit to commit. git submodule update --init fetches from the URL a submodule was first initialized with, not from the URL in the current .gitmodules. When a repository moves a submodule to another remote (for example, to its own fork) and pins a commit that only the new remote has, every pass fails with upload-pack: not our ref <sha>. The failure is classified pin_missing, and its fix tells the operator to repin, which the operator cannot do because the pin exists upstream. A deployment indexing a large C++ repository hit this when the repository moved one dependency to a fork. Its checkouts all still pointed at the old remote, and the tier stayed thousands of commits behind.

git submodule sync copies each URL from the checked-out .gitmodules into the checkout's config. Both tier paths that move a checkout (scip_full.move_checkout and the code_scip_delta worker) now call one helper, compiler_tier.update_submodules. It syncs and updates the top level, then syncs recursively, so each nested URL comes from its parent's new tree, and then updates recursively.

Scope and risk

  • Each sync is a local git job: no network and no token. Each update keeps its network, token, proxy identity, timeout and retry. Each pass now runs two networked updates; the second starts with the top level already at its pins.
  • A submodule two levels down that moved with its parent is fetched in the same pass. One three levels down is synced from its parent's old tree, so its pass fails once and the next pass recovers.
  • The Python, Go and TypeScript tiers do not update submodules and are unchanged.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none. A checkout that is failing this way recovers on its next pass.
  • Rollback: reverting leaves the synced URLs in each checkout's .git/config. They are the URLs the repository names, so nothing needs cleaning up.

Tests

  • tests/unit/test_submodule_url_sync.py (new) builds a repository whose submodule moves to a fork, with the new pin only on the fork, and runs update_submodules with plain git. Without the sync it fails with fatal: remote error: upload-pack: not our ref … / Fetched in submodule path 'sub', but it did not contain …, the same error as the deployment. With the sync it passes.
  • A second test there moves a nested submodule to a fork in the same commit that bumps its parent. With the earlier order (one recursive sync, then the update) it fails with Fetched in submodule path 'mid/leaf', but it did not contain …. With the current order it passes.
  • test_code_scip_delta_worker.py and test_repo_job_sandbox.py now assert that the sync runs before the update and that only the update is networked and authenticated.
  • The three changed test files and test_code_scip_full_worker.py pass (86 tests). The repo-wide ratchet, census, snapshot, public-copy and doc-link files pass. make format is clean. The lint --check steps pass, except the Go and Rust SDK generators, which need gofmt and rustfmt, neither installed on this host. make typecheck reports only errors in files this PR does not touch (server/llm/vertex_auth.py, server/observability/otel*.py), from the shared environment's installed packages.

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. The failing case was reproduced from the deployment's checkouts: their submodule config named the old remote, while the commit was present on the new one.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand (none affected).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited (none).
  • A behaviour change to any file a plugin ships bumps both plugin manifests' version (none).
  • The frontend builds, if frontend/ changed (unchanged).
  • Docs under docs/ describe the system as it now is (no doc describes the update step).
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers.
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code


Note

Medium Risk
Changes git checkout behavior on every C++ tier pass (extra sync/update steps and network submodule fetches); limited to compiler-tier paths, not auth or data stores.

Overview
Fixes C++ compiler-tier checkouts that stall when a repository moves a submodule to another remote and pins a commit only on the new URL. Long-lived checkouts still had the submodule’s original remote in local config, so git submodule update failed with missing-pin errors even though the pin was valid upstream.

The diff adds compiler_tier.update_submodules, which runs submodule sync from the target’s .gitmodules (local, no token), then submodule update --init (networked with existing auth), first at the top level and again recursively so nested .gitmodules come from parents already at their pins. scip_full.move_checkout and the scip_delta worker call this helper instead of a single recursive update. Tests now expect sync-then-update ordering and add test_submodule_url_sync.py for moved top-level and nested submodules.

Reviewed by Cursor Bugbot for commit a9c94ce. Bugbot is set up for automated code reviews on this repo. Configure here.

`git submodule update --init` fetches from the URL a submodule was first
initialized with, so a submodule the repository moved to another remote
looked for its new pins in the old one and failed with "not our ref" on
every pass. Both checkout paths now call compiler_tier.update_submodules,
which runs a local `git submodule sync --recursive` first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Building Building Preview Dec 3, 2026 12:06pm UTC
loom-telemetry Ready Ready Preview Dec 3, 2026 12:06pm UTC

Request Review

zlareb1 and others added 5 commits December 3, 2026 11:44
…it in the hold test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…pass

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant