Repository navigation
Add serve-multi: one query service for several repositories - #618
Merged
tinder-maxwellelliott merged 1 commit intoNov 4, 2026
Merged
Conversation
`bazel-diff serve-multi --repo NAME=PATH ...` serves several git clones from one process. Each repository gets its own workspace lock, git/Bazel binding, readiness flag and counters, so queries on different repositories run concurrently; the memory, disk and remote cache tiers are shared, since cache keys are tree + configuration fingerprint and identical trees in two clones share an entry on purpose. Requests select a repository with `repo=` (query string on GET/POST; a POST body `repo` wins). With one repository the parameter is optional; with several, a missing `repo` is a 400 and an unknown one a 404, both listing the served names. `/health` reports all repositories ready; `/metrics` keeps its top-level fields as aggregates and adds a `repositories` map. Startup fetch and warmup run per repository in parallel. `serve` is unchanged (its one repository is named `default`). `serve-multi` flattens `ServeArgs` so the two commands share every flag; `--workspacePath` is hidden and rejected there, which is why `HashingArgs.workspace_path` became `Option<PathBuf>` with `required = true`. Adds CLI parsing tests, a routing unit test over two real git repos, the e2e case `core::serve_multiple_repositories`, and README docs (including the `serve-multi` CLI help block). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
tinder-maxwellelliott
deleted the
maxwelle/serve-multiple-repos-97dfc0
branch
November 4, 2026 00:57
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.
Summary
bazel-diff serve-multi --repo NAME=PATH [--repo NAME=PATH ...]runs the impacted-target query service for several git clones in one process.serveis untouched.--cacheDirand remote (S3/GCS/Nexus) tiers are shared: cache keys are tree hash + configuration fingerprint, so identical trees in two clones share one entry by design.repo=(query string on GET and POST; a POST bodyrepowins). One repository →repois optional. Several → missingrepois a 400, unknown is a 404; both errors list the served names. The readiness check now runs after input parsing and per repository./healthand/metrics./healthis ready when every repository is./metricskeeps its existing top-level fields as aggregates (summed counters, any-busy) and adds arepositoriesmap with per-repo workspace/ready/activeQueries/workspaceBusy/counters.ServeMultiArgsflattensServeArgs, so everyserveflag is available and the two can't drift;--workspacePathis hidden and conflicts with--repo. To support that,HashingArgs.workspace_pathbecameOption<PathBuf>withrequired = true(accessed viaHashingArgs::workspace());serve --helpis byte-identical to before.Tests
//src:cli_tests:serve-multiparsing (normalization, missing/conflicting/invalid--repo, duplicate names) andserveunchanged.//src:rust_tests: repository name/spec validation; routing across two real git repositories (400/404/200, POST body precedence, shared cache key for identical trees, per-repo readiness,/metricsshape).core::serve_multiple_repositories(two workspaces, divergent edits, cross-repo SHA rejected, metrics), plus the existing serve e2e cases.//tools/e2e:regen_check, README generator build, clippy clean.Docs
README (template + generated) gains a "Serving several repositories" section, the
repo=parameter on the endpoints, therepositoriesmetrics field, and theserve-multiCLI help block.🤖 Generated with Claude Code