Skip to content

refactor(serve)!: remove JGit engine, make subprocess the only git backend#423

Merged
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/remove-jgit-integration-26f96a
Jul 10, 2026
Merged

refactor(serve)!: remove JGit engine, make subprocess the only git backend#423
tinder-maxwellelliott merged 1 commit into
masterfrom
claude/remove-jgit-integration-26f96a

Conversation

@tinder-maxwellelliott

Copy link
Copy Markdown
Collaborator

What & why

Makes the native git subprocess (ProcessGitClient) the only git engine for bazel-diff serve and removes the in-process JGit integration entirely, per request to "make subprocess the only option for now."

This also resolves the pending partial-clone checkout failure JGit 5.13 could not handle — it has no promisor/lazy-fetch, so checking out a revision whose trees/blobs weren't materialized by the initial clone threw JGit checkout … Missing unknown <sha>. Native git fetches those blobs on demand at checkout, so the previously-proposed JGitClient.checkout() fallback is now moot.

Changes

  • Deleted JGitClient.kt, JGitClientTest.kt, and Slf4jBindingTest.kt (the slf4j-nop runtime dep existed only to silence JGit's NOP-logger warning).
  • Dropped the org.eclipse.jgit, slf4j-nop, and slf4j-api Maven deps from MODULE.bazel / cli/BUILD and repinned maven_install.json (−111 lines: jgit, JavaEWAH, both slf4j jars).
  • Removed the --gitEngine flag; ServeCommand.createGitClient() now always returns ProcessGitClient. Updated the --gitPath help text (no longer conditioned on the removed flag).
  • /metrics gitEngine now reports the literal "subprocess". The field is intentionally kept so the metrics JSON contract stays stable (and is easy to re-expand if another engine returns).
  • serve_harness.py: removed the engine dimension — the harness existed to assert cross-engine parity, which no longer applies. Cases are now full / full+deps / shallow / partial.
  • Docs: README/template prose, the /metrics example, and the regenerated serve --help block.

Validation

  • //cli:bazel-diff builds clean without JGit.
  • Serve/server unit tests pass: ServeCommandTest, MetricsServiceTest, BazelDiffServerTest, GitClientTest, HashServiceTest, ImpactedTargetsServiceTest, CachePrunerTest, LocalDiskHashCacheStorageTest, StderrLoggerTest.
  • E2ETest#testServeEndToEnd passes — it stands up a real git repo and runs serve with no --gitEngine, so it now exercises the subprocess (ProcessGitClient) path end-to-end (resolve/checkout + real bazel query + distances + cache).
  • ktfmt and buildifier clean.
  • The 4 unrelated E2ETest failures (cquery/bzlmod/external-repo/Android) are the pre-existing sandbox environment issue (nested bazel can't reach the network / locate a JDK for coursier), not caused by this change.

⚠️ Breaking change

  • The --gitEngine flag is removed. Invocations passing --gitEngine=subprocess should drop the flag; --gitEngine=jgit (the previous default) is no longer available.
  • A git binary must now be on PATH (the old default JGit engine required none).

Suggest a major version bump (→ 33.0.0) on release. If softer back-compat is preferred, --gitEngine could instead be kept as a hidden, deprecated no-op that accepts only subprocess — happy to add that.

🤖 Generated with Claude Code

…ckend

Make the native `git` subprocess (`ProcessGitClient`) the sole git engine for
`bazel-diff serve` and remove the in-process JGit integration entirely.

- Delete JGitClient, its test, and the SLF4J binding test (the slf4j-nop dep
  existed only to silence JGit's NOP-logger warning); drop the org.eclipse.jgit,
  slf4j-nop, and slf4j-api maven deps and repin maven_install.json.
- Remove the `--gitEngine` flag; `createGitClient()` always returns
  ProcessGitClient. `/metrics` `gitEngine` now reports the literal "subprocess"
  (field kept so the JSON contract is stable).
- Update serve_harness.py to drop the engine dimension (its cross-engine parity
  gates no longer apply); update README/template prose, the /metrics example,
  and the regenerated `serve --help` block.

This also resolves the partial-clone checkout failure JGit 5.13 could not handle
(it has no promisor/lazy-fetch): native git fetches the missing blobs at checkout.

Validated: binary builds, the serve/server unit tests pass, and E2E
`testServeEndToEnd` (real git repo, no `--gitEngine`) exercises the subprocess
path end-to-end and passes.

BREAKING CHANGE: the `--gitEngine` flag is removed and a `git` binary must now be
on PATH. Invocations passing `--gitEngine=subprocess` should drop the flag;
`--gitEngine=jgit` (the previous default) is no longer available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tinder-maxwellelliott tinder-maxwellelliott marked this pull request as ready for review July 10, 2026 20:20
@tinder-maxwellelliott tinder-maxwellelliott merged commit 149fb61 into master Jul 10, 2026
15 checks passed
@tinder-maxwellelliott tinder-maxwellelliott deleted the claude/remove-jgit-integration-26f96a branch July 10, 2026 20:20
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