Skip to content

refactor(renderer): remove the runtime-git-client barrel - #27977

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5d
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5d

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 27 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​67 $\color{#cf222e}{\Huge{\mathbf{−}}}$​55 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12
Prod 41 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​57 $\color{#cf222e}{\Huge{\mathbf{−}}}$​113 $\color{#cf222e}{\Huge{\mathbf{−}}}$​56

ELI5

src/renderer/src/runtime/runtime-git-client.ts only re-exported functions from seven runtime-git-* modules (context, diff, generation, status, sync, working tree). This PR points every importer at the module that defines what it uses, and deletes the forwarding file.

What Changed

Users see no difference.

  • About 44 renderer files now import from runtime-git-{diff,generation,status,sync,working-tree}-client or runtime-git-client-context.
  • Tests: each mock of the barrel is split per defining module with the same values. The PR-field generation mocks now mock runtime-git-generation-client, the discard/stage mocks runtime-git-working-tree-client, and the fork-sync and upstream-status mocks runtime-git-sync-client.

Net: production −56 (+57/−113), tests +12 (+67/−55).

Why

Phase 3.99 / AGENTS.md rule: no barrels and no re-export shims. With direct imports, each import line names the module a file really depends on, and each test mocks the module the code under test actually calls. One barrel per PR keeps every review mechanical.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.5d).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • No import, mock or import() of runtime/runtime-git-client remains in src tests mobile config .github.

  • All 27 changed test files pass (199 tests).

  • pnpm tc, pnpm lint and pnpm run check:code-quality:changed (0 findings) pass on the whole barrel stack.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

P0/P1 review: my own review plus an independent reviewer.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only import changes. SSH, wire, mobile and platforms are not affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

Walkthrough

The change removes the consolidated runtime Git re-export module and updates renderer consumers and tests to import operations from dedicated runtime Git clients. Diff, generation, status, synchronization, working-tree, and context imports are routed to their respective modules. The summaries report no changes to call sites or behavior.


Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 9b099

The documented lifecycle audit cannot run until its manifest entry for the deleted file is removed. This is a bounded developer-check failure, with no CI gate found to be affected.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 50 files. (17 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the primary change: removing the renderer runtime-git-client barrel.
Description check Passed The description is detailed and covers the change, rationale, scope, testing, visual proof, review, and checklist requirements. The internal linked-issue exception is explained, and the conditional AI…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 50 files. (17 skipped: 17 over the file limit.)


✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Remove the deleted source from the audit manifest. · source-versions.json:1659-1663

docs/audits/closed-editor-model-lifetime/source-versions.json:1659-1663
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Remove the deleted source from the audit manifest.

loadSources() checks that every manifest source exists and matches its recorded hash during Vitest configuration loading. Because src/renderer/src/runtime/runtime-git-client.ts no longer exists, the documented audit command can abort before running its tests. Remove this manifest entry; changing its hashes cannot satisfy the existence check.

Suggested fix
-    "src/renderer/src/runtime/runtime-git-client.ts": {
-      "worktreeBefore": "b3d121c51a6ab0f312fa4a4bc7e3df4d8f263e49c9ac5e9d3fe18d527b868ad7",
-      "mainBefore": "b3d121c51a6ab0f312fa4a4bc7e3df4d8f263e49c9ac5e9d3fe18d527b868ad7",
-      "worktreeFixed": "b3d121c51a6ab0f312fa4a4bc7e3df4d8f263e49c9ac5e9d3fe18d527b868ad7",
-      "mainFixed": "b3d121c51a6ab0f312fa4a4bc7e3df4d8f263e49c9ac5e9d3fe18d527b868ad7"
-    },

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9acd4bbd-e856-4c22-a7ad-c540c245a264
📥 Commits

Reviewing files that changed from the base of the PR and between 5763792 and 9b09947.

📒 Files selected for processing (68)
  • src/renderer/src/components/editor/MonacoGutterContextMenu.tsx
  • src/renderer/src/components/editor/combined-diff/load-sections/fetch-combined-diff-section.ts
  • src/renderer/src/components/editor/useEditorPanelContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelDiffContentLoader.ts
  • src/renderer/src/components/editor/useEditorPanelFloatingTabContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelHostUnresolvedContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelRemoteSiblingContentState.test.tsx
  • src/renderer/src/components/editor/useEditorPanelVisibilityContentState.test.tsx
  • src/renderer/src/components/native-chat/native-chat-session-option-discovery.ts
  • src/renderer/src/components/native-chat/native-chat-session-option-enrichment.test.ts
  • src/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-generation.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-generation.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-git-status-effects.test.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-git-status-effects.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-manual-refresh.tsx
  • src/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-review-state.tsx
  • src/renderer/src/components/right-sidebar/create-pull-request-dialog-field-model.ts
  • src/renderer/src/components/right-sidebar/git-status-refresh.ts
  • src/renderer/src/components/right-sidebar/source-control/ai/use-ai.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/discard-all-failure-description.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/source-control-discard-editor-owner.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/source-control-entry-mutation-failures.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/use-bulk-actions-capped-stage.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/commit/use-bulk-actions.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/use-commit-action.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/use-commit-message-generation.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/use-discard-confirmation.ts
  • src/renderer/src/components/right-sidebar/source-control/commit/use-entry-mutations.ts
  • src/renderer/src/components/right-sidebar/source-control/listing/operation-target.ts
  • src/renderer/src/components/right-sidebar/source-control/listing/use-submodule-status.ts
  • src/renderer/src/components/right-sidebar/source-control/review/create-pr-intent-run-snapshot.ts
  • src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-commit-message.ts
  • src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-probes.ts
  • src/renderer/src/components/right-sidebar/source-control/review/use-create-pr-intent-review.ts
  • src/renderer/src/components/right-sidebar/source-control/review/use-hosted-review-creation.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.test.tsx
  • src/renderer/src/components/right-sidebar/source-control/review/use-pull-request-generation.ts
  • src/renderer/src/components/right-sidebar/source-control/sync/use-branch-compare.ts
  • src/renderer/src/components/right-sidebar/source-control/sync/use-conflict-abort.ts
  • src/renderer/src/components/right-sidebar/source-control/sync/use-git-history-commit-actions.ts
  • src/renderer/src/components/right-sidebar/source-control/sync/use-git-history.ts
  • src/renderer/src/components/right-sidebar/stale-conflict-operation-poll.ts
  • src/renderer/src/components/right-sidebar/use-create-pull-request-field-generation.ts
  • src/renderer/src/components/right-sidebar/use-create-pull-request-field-seeding.ts
  • src/renderer/src/components/right-sidebar/use-file-explorer-ignored-paths.ts
  • src/renderer/src/components/right-sidebar/use-git-status-upstream-ref-watch.test.ts
  • src/renderer/src/components/right-sidebar/use-git-status-upstream-ref-watch.ts
  • src/renderer/src/components/right-sidebar/use-source-control-branch-compare.test.tsx
  • src/renderer/src/components/right-sidebar/use-source-control-git-history.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerTree.refresh-projection-churn.test.tsx
  • src/renderer/src/components/right-sidebar/useFileExplorerVisibleRowProjection.debounce.test.tsx
  • src/renderer/src/components/right-sidebar/useSourceControlSubmoduleStatus.test.tsx
  • src/renderer/src/components/settings/CommitMessageAiPane.tsx
  • src/renderer/src/components/settings/RepositoryForkSyncSection.test.tsx
  • src/renderer/src/components/settings/RepositoryForkSyncSection.tsx
  • src/renderer/src/components/sidebar/delete-worktree-dirty-change-hydration.test.tsx
  • src/renderer/src/components/sidebar/use-delete-worktree-status-hydration.ts
  • src/renderer/src/components/status-bar/use-workspace-space-git-refresh-action.ts
  • src/renderer/src/runtime/runtime-git-client-branch-line-total.test.ts
  • src/renderer/src/runtime/runtime-git-client-merge.test.ts
  • src/renderer/src/runtime/runtime-git-client.test.ts
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/store/repos/safe-auto-fork-sync.ts
  • src/renderer/src/store/slices/editor/actions/git-remote-push-pull.ts
  • src/renderer/src/store/slices/editor/actions/git-remote-status.ts
  • src/renderer/src/store/slices/editor/actions/git-remote-sync.ts
  • src/renderer/src/store/slices/repos-module-lifetime-coordinators.test.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/runtime/runtime-git-client.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@OrcaWin
OrcaWin merged commit 6be6090 into main Oct 12, 2026
30 checks passed
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