Skip to content

Commit fd0d706

Browse files
refactor(server): GitHub source control reads GitHubApi directly
GitHubRepositoryApi was a pass-through left from the gh days: it served only GitHubSourceControlProvider, which already called GitHubApi itself for link previews and discovery, so every caller saw three GitHub layers and every test mocked two GitHub services. Fold it into the provider. Repository resolution (gh's remote ranking, gh-resolved marks, SSH aliases, reference parsing) moves to a plain module, gitHubRepositoryResolution.ts, with its own tests. The batched head lookups, checkout, and writes now live in the provider and fail straight to SourceControlProviderError with the same user-facing detail. GitHubApi gains layerWithDependencies, so the server, ws harness and PR provider registry share one budget and pause per host without each re-listing the credential, budget and rate-limit layers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 216f208 commit fd0d706

21 files changed

Lines changed: 1689 additions & 2291 deletions

‎apps/server/scripts/evaluate-thread-titles.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from "../src/textGeneration/ThreadTitleContext.ts";
2424
import * as ThreadTitleLinks from "../src/textGeneration/ThreadTitleLinks.ts";
2525
import * as SourceControlProviderRegistry from "../src/sourceControl/SourceControlProviderRegistry.ts";
26-
import * as GitHubRepositoryApi from "../src/sourceControl/GitHubRepositoryApi.ts";
26+
import * as GitHubApi from "../src/sourceControl/GitHubApi.ts";
2727
import * as GitLabCli from "../src/sourceControl/GitLabCli.ts";
2828
import * as ForgejoCli from "../src/sourceControl/ForgejoCli.ts";
2929
import * as AzureDevOpsCli from "../src/sourceControl/AzureDevOpsCli.ts";
@@ -152,7 +152,7 @@ await Effect.runPromise(
152152
SourceControlProviderRegistry.layer.pipe(
153153
Layer.provide(
154154
Layer.mergeAll(
155-
GitHubRepositoryApi.layer,
155+
GitHubApi.layerWithDependencies,
156156
GitLabCli.layer,
157157
ForgejoCli.layer,
158158
AzureDevOpsCli.layer,

0 commit comments

Comments
 (0)