refactor(server): classify source control exports#10279

merged1
cleanup-server/provider-internals
cleanup-server/source-control-internals
openedSep 6, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 7d ago

Source-control and pull-request modules had 26 unclassified runtime exports. This marks 13 canonical Effect service constructors as intentionally public, narrows local parsing and formatting helpers, and removes four redundant generic provider layers whose modules do not own the service tag.

This is layer 6 of 9 in the server Knip cleanup stack.

Verification after rebasing onto current main: server typecheck and the server-only Knip export audit pass. Changed-file lint and formatting pass, with one existing lint warning. Focused auth, provider, source-control, preview toolkit, orchestration, and Knip preprocessor tests pass: 90 tests across 9 files. This changes server export visibility and static analysis; screenshots do not apply.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Summary by CodeRabbit

  • Documentation

    • Added public API documentation for service construction across source control and pull request integrations.
    • Clarified which service entry points are intended for public use.
  • Refactor

    • Removed unused helper exports, error-formatting aliases, and prebuilt provider layers.
    • Internalized implementation details while preserving source control operations, decoding behavior, and runtime functionality.
    • Reduced the publicly exposed API surface for implementation-only utilities.
Synced from GitHub

Bugbot is paused β€” on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Synced from GitHub

Thread transfer impact

βœ… Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wireβ€”13.6 KiBβ€”15.1 KiBβœ…
CodexThread snapshot wireβ€”7.0 KiBβ€”7.3 KiBβœ…
CodexLive turn WebSocket wireβ€”6.6 KiBβ€”7.8 KiBβœ…
CodexLive turn WebSocket decodedβ€”57.1 KiBβ€”66.4 KiBβœ…
CodexLive turn messagesβ€”10β€”21βœ…
ClaudeTotal thread wireβ€”13.6 KiBβ€”15.1 KiBβœ…
ClaudeThread snapshot wireβ€”7.0 KiBβ€”7.3 KiBβœ…
ClaudeLive turn WebSocket wireβ€”6.5 KiBβ€”7.8 KiBβœ…
ClaudeLive turn WebSocket decodedβ€”57.8 KiBβ€”66.4 KiBβœ…
ClaudeLive turn messagesβ€”9β€”21βœ…

Baseline: unavailable Β· PR result: 3006c87 Β· Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Approved at 0f3e28d

Macroscope's review found this PR approvable β€” This is a bounded internal server export cleanup: active provider construction and source-control behavior remain unchanged, while unused wrappers and helpers are made private or removed. No product defaults, static-analysis suppressions, schema changes, or production behavior changes are involved.

No code changes detected at 3006c87. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Added 1 commit

  • refactor(server): remove unused source control exports3006c87
Synced from GitHub

Bugbot is paused β€” on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Synced from GitHub

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d5647126-4e5b-4e08-a946-dc9ea539234f

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 375ccee2e02f7813c81301724d12be054af1e5b1 and 3006c8731afadb92c6bda06891c29bfe01387539.

πŸ“’ Files selected for processing (22)
  • apps/server/src/pullRequest/AzureDevOpsPullRequestCli.ts
  • apps/server/src/pullRequest/BitbucketPullRequestApi.ts
  • apps/server/src/pullRequest/GitHubPullRequestCli.ts
  • apps/server/src/pullRequest/GitLabPullRequestCli.ts
  • apps/server/src/pullRequest/PullRequestProviderRegistry.ts
  • apps/server/src/sourceControl/AzureDevOpsCli.ts
  • apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts
  • apps/server/src/sourceControl/BitbucketApi.ts
  • apps/server/src/sourceControl/BitbucketSourceControlProvider.ts
  • apps/server/src/sourceControl/GitHubCli.ts
  • apps/server/src/sourceControl/GitHubSourceControlProvider.ts
  • apps/server/src/sourceControl/GitLabCli.ts
  • apps/server/src/sourceControl/GitLabSourceControlProvider.ts
  • apps/server/src/sourceControl/SourceControlDiscovery.ts
  • apps/server/src/sourceControl/SourceControlProvider.ts
  • apps/server/src/sourceControl/SourceControlProviderDiscovery.ts
  • apps/server/src/sourceControl/SourceControlRateLimit.ts
  • apps/server/src/sourceControl/SourceControlRepositoryService.ts
  • apps/server/src/sourceControl/azureDevOpsPullRequests.ts
  • apps/server/src/sourceControl/gitHubPullRequests.ts
  • apps/server/src/sourceControl/gitLabMergeRequests.ts
  • apps/server/src/sourceControl/githubGraphQlBudget.ts
πŸ’€ Files with no reviewable changes (4)
  • apps/server/src/sourceControl/GitHubSourceControlProvider.ts
  • apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts
  • apps/server/src/sourceControl/BitbucketSourceControlProvider.ts
  • apps/server/src/sourceControl/GitLabSourceControlProvider.ts
🚧 Files skipped from review as they are similar to previous changes (18)
  • apps/server/src/pullRequest/GitLabPullRequestCli.ts
  • apps/server/src/sourceControl/SourceControlProvider.ts
  • apps/server/src/sourceControl/SourceControlDiscovery.ts
  • apps/server/src/pullRequest/GitHubPullRequestCli.ts
  • apps/server/src/sourceControl/GitLabCli.ts
  • apps/server/src/pullRequest/AzureDevOpsPullRequestCli.ts
  • apps/server/src/sourceControl/SourceControlRepositoryService.ts
  • apps/server/src/sourceControl/SourceControlProviderDiscovery.ts
  • apps/server/src/sourceControl/BitbucketApi.ts
  • apps/server/src/sourceControl/gitHubPullRequests.ts
  • apps/server/src/pullRequest/BitbucketPullRequestApi.ts
  • apps/server/src/pullRequest/PullRequestProviderRegistry.ts
  • apps/server/src/sourceControl/githubGraphQlBudget.ts
  • apps/server/src/sourceControl/gitLabMergeRequests.ts
  • apps/server/src/sourceControl/SourceControlRateLimit.ts
  • apps/server/src/sourceControl/GitHubCli.ts
  • apps/server/src/sourceControl/azureDevOpsPullRequests.ts
  • apps/server/src/sourceControl/AzureDevOpsCli.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


πŸ“ Walkthrough

Walkthrough

The change documents Effect service constructors as public APIs and narrows module exports. It removes selected helper exports, schema error aliases, and prebuilt source-control provider layers without changing provider or helper behavior.

Changes

Effect API surface cleanup

Layer / File(s)Summary
Document public service constructors
apps/server/src/pullRequest/*, apps/server/src/sourceControl/*
Adds @public documentation to service-construction exports.
Internalize helper and formatting exports
apps/server/src/pullRequest/GitHubPullRequestCli.ts, apps/server/src/sourceControl/*
Makes selected helpers module-private and removes schema error formatting aliases and unused imports.
Remove provider layer exports
apps/server/src/sourceControl/*SourceControlProvider.ts
Removes exported provider layer values and their unused Layer imports.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: βšͺ Minimal Β· up to 3006c

This change narrows server module exports and documents intended public service constructors without a described runtime behavior change. No concrete merge-blocking risk remains.

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 15.79% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 18 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (4 passed)
Check nameStatusExplanation
Title checkβœ… PassedThe title is concise and accurately summarizes the primary change: classifying source-control exports in the server.
Description checkβœ… PassedThe description clearly explains what changed, why it changed, scope, verification results, and why screenshots do not apply. It does not use the template headings or checklist, but it provides the re…
Linked Issues checkβœ… PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkβœ… PassedCheck skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches πŸ’‘ 1
πŸ“ Generate docstrings πŸ’‘
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-server/source-control-internals

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