Repository navigation
The C++ compiler tier fetches submodule pins with the entry's GitHub token - #341
Merged
Merged
Conversation
…token
`git submodule update` in the compiler-tier checkout ran with no credential, so a
repository whose .gitmodules names a private submodule on its own host failed
every C++ delta and full pass at the first pin the checkout did not already hold
("could not read Username for 'https://github.com'"), and the tier fell
further behind with each merge. `compiler_tier.git` now takes the entry's token
and remote for a networked call, carried as an extraheader exactly as the
mirror fetch does; local fetches from the bare clone still carry none.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
…sport stays off submodules auth_env keyed the token's extraheader to the whole host, so a submodule URL naming another owner's repository would carry it. It is now keyed to https://host/owner/ (the host alone for a remote with no owner path). The compiler tier's networked git takes the file transport from the bare clone alone, so a local-mirror entry does not open file:// .gitmodules URLs. Tests cover the delta worker's submodule token, the owner scope and the local remote; the security section names the submodule update. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…remote's owner, case as written Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…odule URL is said to fail Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
9 tasks done
… remote is shown to get no header Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…owner the token reads Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ions list Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…ne helper Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…module-token Signed-off-by: zlareb1 <[email protected]>
…module-token Signed-off-by: zlareb1 <[email protected]>
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.
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 C/C++ compiler tier fetches submodule pins with the repository entry's GitHub token, so a repository with a private submodule of its own owner no longer stalls its compiler tier at the first pin the checkout lacks.
Why
git submodule updatein the compiler-tier checkout ran throughcompiler_tier.git, which built its environment withauth_env(remote=...)and no token. The mirror fetch (pass_fetch,bootstrap) authenticates withcfg.github_token, so the tree-sitter tier stayed current while every C++ delta and full pass for such an entry failed with:The entry's compiler tier then fell one commit further behind per merge (413 commits on one deployment). The pass isolated the failure per entry, so other entries kept indexing and nothing flagged it beyond the pass's error count.
compiler_tier.gitnow takestokenandremotefor a networked call and hands them toauth_env, which carries the token as an extraheader, never in argv or stored config, as the mirror fetch does. The delta worker andscip_full.move_checkoutpass the entry'sgithub_tokenandgit_remoteon theirsubmodule update.Submodule URLs come from the indexed repository's
.gitmodules, so whoever can commit to it picks them.auth_envused to key the header to the whole host (http.https://github.com/.extraheader). It now keys it to the remote's owner (http.https://github.com/<owner>/.extraheader; the host alone for a remote with no owner path). The token reaches that owner's repositories and nothing else on the host, for the mirror fetch and the submodule update alike. This narrows the header: no fetch Loom makes sends the token outside the remote's owner (the host, for a remote with no owner path). The networked compiler-tier git takes thefiletransport from the bare clone alone, so an entry whose remote is a local mirror does not openfile://submodule URLs.Scope and risk
submodule updatecalls of the C/C++ tier and the key ofauth_env's extraheader. Local fetches from the bare clone and the Go, Python and TypeScript tiers' git calls get no token, as before.https://host/owner/; the whole host for a remote with no owner path). A submodule of another owner, or on another host, gets none. The egress proxy and sandbox still apply..gitmodulesURL resolves against the checkout, which has no remote, and thefiletransport is off, so it still fails; an owner spelled in another case than the remote's gets no token (git matches the prefix byte for byte). The operations page says both.Compatibility, rollout and rollback
Tests
test_scip_full_moves_its_checkout_as_sandboxed_jobsandtest_code_scip_delta_worker.py::test_fetch_does_not_recurse_submodulesassert thatsubmodule updategets the entry's token and remote and that the bare-clone fetch gets none.test_a_networked_compiler_tier_git_authenticates_to_the_repository_owner: the job environment hashttp.https://github.com/o/.extraheader, the token is not in argv, and a call without a token has no extraheader.test_a_local_remote_entry_keeps_the_file_transport_off_its_submodules: noprotocol.file.allowfor a local-mirror entry, with or without a token.test_gitrepo_token_env.py::test_git_matches_the_header_to_the_remote_owner_only: real git'sconfig --get-urlmatchgives the header for a repository of the remote's owner and none for another owner, an owner with the same prefix (o-evil) or another host.test_gitrepo_token_env.py::test_an_ssh_remote_gets_no_extraheader: a token with an ssh remote adds no header.test_gitrepo_token_env.py::test_the_token_is_sent_only_under_the_remote_owner: owner scope for GitHub, a GitLab subgroup, a remote with no owner path and an owner-only remote, which falls back to the host.make format lintand the sandbox, scip-delta, scip-full, token-env, hostile-sandbox, public-copy and doc-links unit files: 304 passed, 13 skipped.auth_env(token, <private repo remote>):git ls-remoteof a private sibling repository of the same owner exits 0, and exits 128 ("could not read Username") without the token. UnderGIT_TRACE_CURL, the request to a repository of another owner carries no Authorization header, and the request to the same owner does.make typechecklocally fails only onextractor/loom_extractor/sql.py(nosqlglotin this virtualenv), a file this diff does not touch. CI runs it with the extractor's dependencies.git submodule update --init --recursivewithGIT_TERMINAL_PROMPT=0exits 0.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. Checked: the token path matches
pass_fetch's, local fetches stay credential-free, both submodule callers are covered, and real git sends the header to the remote's owner only.I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format lintand the touched unit files pass locally;make typecheckfails locally only onextractor/loom_extractor/sql.py(a missing dependency), and CI runs typecheck, the whole unit suite and the integration suite.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.🤖 Generated with Claude Code