Standardize VCS layer imports across server tests
- Switch GitVcsDriver and VcsProcess usages to namespace imports - Update server and integration wiring to use `.layer` consistently - Keep test type annotations aligned with the exported service types
This commit is contained in:
1 parent
8f09b8d0ab
commit
5e0327dee6
8 files changed
+48
-44
No files matched your search
@@ -76,8 +76,8 @@ import {
|
||||
import { deriveServerPaths, ServerConfig } from "../src/config.ts";
|
||||
import { WorkspaceEntriesLive } from "../src/workspace/Layers/WorkspaceEntries.ts";
|
||||
import { WorkspacePathsLive } from "../src/workspace/Layers/WorkspacePaths.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../src/vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../src/vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../src/vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../src/vcs/VcsProcess.ts";
|
||||
|
||||
function runGit(cwd: string, args: ReadonlyArray<string>) {
|
||||
return execFileSync("git", args, {
|
||||
@@ -292,7 +292,7 @@ export const makeOrchestrationIntegrationHarness = (
|
||||
Layer.provide(providerEventLoggersLayer),
|
||||
);
|
||||
|
||||
const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer));
|
||||
const checkpointStoreLayer = CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer));
|
||||
const projectionSnapshotQueryLayer = OrchestrationProjectionSnapshotQueryLive;
|
||||
const runtimeServicesLayer = Layer.mergeAll(
|
||||
projectionSnapshotQueryLayer,
|
||||
@@ -343,12 +343,12 @@ export const makeOrchestrationIntegrationHarness = (
|
||||
Layer.provideMerge(
|
||||
WorkspaceEntriesLive.pipe(
|
||||
Layer.provide(WorkspacePathsLive),
|
||||
Layer.provideMerge(GitVcsDriverLayer),
|
||||
Layer.provideMerge(GitVcsDriver.layer),
|
||||
Layer.provide(NodeServices.layer),
|
||||
),
|
||||
),
|
||||
Layer.provideMerge(WorkspacePathsLive),
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
);
|
||||
const orchestrationReactorLayer = OrchestrationReactorLive.pipe(
|
||||
Layer.provideMerge(runtimeIngestionLayer),
|
||||
|
||||
@@ -8,9 +8,9 @@ import { describe, expect } from "vitest";
|
||||
import { checkpointRefForThreadTurn } from "../Utils.ts";
|
||||
import { CheckpointStoreLive } from "./CheckpointStore.ts";
|
||||
import { CheckpointStore } from "../Services/CheckpointStore.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts";
|
||||
import { VcsProcess } from "../../vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../../vcs/VcsProcess.ts";
|
||||
import { VcsProcess as VcsProcessService } from "../../vcs/VcsProcess.ts";
|
||||
import type { VcsError } from "@t3tools/contracts";
|
||||
import { ServerConfig } from "../../config.ts";
|
||||
import { ThreadId } from "@t3tools/contracts";
|
||||
@@ -18,8 +18,8 @@ import { ThreadId } from "@t3tools/contracts";
|
||||
const ServerConfigLayer = ServerConfig.layerTest(process.cwd(), {
|
||||
prefix: "t3-checkpoint-store-test-",
|
||||
});
|
||||
const VcsProcessTestLayer = VcsProcessLayer.pipe(Layer.provide(NodeServices.layer));
|
||||
const VcsDriverTestLayer = GitVcsDriverLayer.pipe(Layer.provide(VcsProcessTestLayer));
|
||||
const VcsProcessTestLayer = VcsProcess.layer.pipe(Layer.provide(NodeServices.layer));
|
||||
const VcsDriverTestLayer = GitVcsDriver.layer.pipe(Layer.provide(VcsProcessTestLayer));
|
||||
const CheckpointStoreTestLayer = CheckpointStoreLive.pipe(
|
||||
Layer.provideMerge(VcsDriverTestLayer),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
@@ -53,9 +53,9 @@ function writeTextFile(
|
||||
function git(
|
||||
cwd: string,
|
||||
args: ReadonlyArray<string>,
|
||||
): Effect.Effect<string, VcsError, VcsProcess> {
|
||||
): Effect.Effect<string, VcsError, VcsProcessService> {
|
||||
return Effect.gen(function* () {
|
||||
const process = yield* VcsProcess;
|
||||
const process = yield* VcsProcessService;
|
||||
const result = yield* process.run({
|
||||
operation: "CheckpointStore.test.git",
|
||||
command: "git",
|
||||
@@ -69,7 +69,11 @@ function git(
|
||||
|
||||
function initRepoWithCommit(
|
||||
cwd: string,
|
||||
): Effect.Effect<void, VcsError | PlatformError.PlatformError, VcsProcess | FileSystem.FileSystem> {
|
||||
): Effect.Effect<
|
||||
void,
|
||||
VcsError | PlatformError.PlatformError,
|
||||
VcsProcessService | FileSystem.FileSystem
|
||||
> {
|
||||
return Effect.gen(function* () {
|
||||
yield* git(cwd, ["init"]);
|
||||
yield* git(cwd, ["config", "user.email", "[email protected]"]);
|
||||
|
||||
@@ -21,8 +21,8 @@ import {
|
||||
GitHubCli,
|
||||
} from "../Services/GitHubCli.ts";
|
||||
import { type TextGenerationShape, TextGeneration } from "../Services/TextGeneration.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../../vcs/VcsProcess.ts";
|
||||
import { VcsDriver } from "../../vcs/VcsDriver.ts";
|
||||
import { makeGitManager } from "./GitManager.ts";
|
||||
import { ServerConfig } from "../../config.ts";
|
||||
@@ -657,8 +657,8 @@ function makeManager(input?: {
|
||||
|
||||
const serverSettingsLayer = ServerSettingsService.layerTest();
|
||||
|
||||
const vcsDriverLayer = GitVcsDriverLayer.pipe(
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
const vcsDriverLayer = GitVcsDriver.layer.pipe(
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
Layer.provideMerge(ServerConfigLayer),
|
||||
);
|
||||
@@ -684,9 +684,9 @@ function makeManager(input?: {
|
||||
|
||||
const asThreadId = (threadId: string) => threadId as ThreadId;
|
||||
|
||||
const GitManagerTestLayer = GitVcsDriverLayer.pipe(
|
||||
const GitManagerTestLayer = GitVcsDriver.layer.pipe(
|
||||
Layer.provide(ServerConfig.layerTest(process.cwd(), { prefix: "t3-git-manager-test-" })),
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
);
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { CheckpointStoreLive } from "../../checkpointing/Layers/CheckpointStore.ts";
|
||||
import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts";
|
||||
import { GitStatusBroadcaster } from "../../git/Services/GitStatusBroadcaster.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../../vcs/VcsProcess.ts";
|
||||
import { RepositoryIdentityResolverLive } from "../../project/Layers/RepositoryIdentityResolver.ts";
|
||||
import { CheckpointReactorLive } from "./CheckpointReactor.ts";
|
||||
import { OrchestrationEngineLive } from "./OrchestrationEngine.ts";
|
||||
@@ -307,15 +307,15 @@ describe("CheckpointReactor", () => {
|
||||
Layer.provideMerge(RuntimeReceiptBusLive),
|
||||
Layer.provideMerge(Layer.succeed(ProviderService, provider.service)),
|
||||
Layer.provideMerge(gitStatusBroadcasterLayer),
|
||||
Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer))),
|
||||
Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer))),
|
||||
Layer.provideMerge(
|
||||
WorkspaceEntriesLive.pipe(
|
||||
Layer.provide(WorkspacePathsLive),
|
||||
Layer.provideMerge(GitVcsDriverLayer),
|
||||
Layer.provideMerge(GitVcsDriver.layer),
|
||||
),
|
||||
),
|
||||
Layer.provideMerge(WorkspacePathsLive),
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
Layer.provideMerge(ServerConfigLayer),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
);
|
||||
|
||||
@@ -46,8 +46,8 @@ import { RepositoryIdentityResolverLive } from "./project/Layers/RepositoryIdent
|
||||
import { WorkspaceEntriesLive } from "./workspace/Layers/WorkspaceEntries.ts";
|
||||
import { WorkspaceFileSystemLive } from "./workspace/Layers/WorkspaceFileSystem.ts";
|
||||
import { WorkspacePathsLive } from "./workspace/Layers/WorkspacePaths.ts";
|
||||
import { layer as GitVcsDriverLayer } from "./vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "./vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "./vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "./vcs/VcsProcess.ts";
|
||||
import { ProjectSetupScriptRunnerLive } from "./project/Layers/ProjectSetupScriptRunner.ts";
|
||||
import { ObservabilityLive } from "./observability/Layers/Observability.ts";
|
||||
import { ServerEnvironmentLive } from "./environment/Layers/ServerEnvironment.ts";
|
||||
@@ -136,7 +136,7 @@ const ReactorLayerLive = Layer.empty.pipe(
|
||||
|
||||
const CheckpointingLayerLive = Layer.empty.pipe(
|
||||
Layer.provideMerge(CheckpointDiffQueryLive),
|
||||
Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriverLayer))),
|
||||
Layer.provideMerge(CheckpointStoreLive.pipe(Layer.provide(GitVcsDriver.layer))),
|
||||
);
|
||||
|
||||
const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe(
|
||||
@@ -158,7 +158,7 @@ const PersistenceLayerLive = Layer.empty.pipe(Layer.provideMerge(SqlitePersisten
|
||||
|
||||
const GitManagerLayerLive = GitManagerLive.pipe(
|
||||
Layer.provideMerge(ProjectSetupScriptRunnerLive),
|
||||
Layer.provideMerge(GitVcsDriverLayer),
|
||||
Layer.provideMerge(GitVcsDriver.layer),
|
||||
Layer.provideMerge(GitHubCliLive),
|
||||
Layer.provideMerge(TextGenerationLive),
|
||||
);
|
||||
@@ -166,14 +166,14 @@ const GitManagerLayerLive = GitManagerLive.pipe(
|
||||
const GitLayerLive = Layer.empty.pipe(
|
||||
Layer.provideMerge(GitManagerLayerLive),
|
||||
Layer.provideMerge(GitStatusBroadcasterLive.pipe(Layer.provide(GitManagerLayerLive))),
|
||||
Layer.provideMerge(GitVcsDriverLayer),
|
||||
Layer.provideMerge(GitVcsDriver.layer),
|
||||
);
|
||||
|
||||
const TerminalLayerLive = TerminalManagerLive.pipe(Layer.provide(PtyAdapterLive));
|
||||
|
||||
const WorkspaceEntriesLayerLive = WorkspaceEntriesLive.pipe(
|
||||
Layer.provide(WorkspacePathsLive),
|
||||
Layer.provideMerge(GitVcsDriverLayer),
|
||||
Layer.provideMerge(GitVcsDriver.layer),
|
||||
);
|
||||
|
||||
const WorkspaceFileSystemLayerLive = WorkspaceFileSystemLive.pipe(
|
||||
@@ -311,7 +311,7 @@ export const makeServerLayer = Layer.unwrap(
|
||||
Layer.provideMerge(HttpServerLive),
|
||||
Layer.provide(ObservabilityLive),
|
||||
Layer.provideMerge(FetchHttpClient.layer),
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
Layer.provideMerge(PlatformServicesLive),
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -6,7 +6,7 @@ import { describe, expect } from "vitest";
|
||||
import { ServerConfig } from "../config.ts";
|
||||
import { VcsProcess } from "./VcsProcess.ts";
|
||||
import { VcsDriver } from "./VcsDriver.ts";
|
||||
import { layer as GitVcsDriverLayer } from "./GitVcsDriver.ts";
|
||||
import * as GitVcsDriver from "./GitVcsDriver.ts";
|
||||
|
||||
const splitNullSeparatedPaths = (input: string): string[] =>
|
||||
input
|
||||
@@ -18,7 +18,7 @@ const GitVcsDriverTestDependencies = ServerConfig.layerTest(process.cwd(), {
|
||||
prefix: "t3-git-vcs-driver-test-",
|
||||
}).pipe(Layer.provide(NodeServices.layer));
|
||||
|
||||
it.layer(Layer.empty)("GitVcsDriverLayer", (it) => {
|
||||
it.layer(Layer.empty)("GitVcsDriver.layer", (it) => {
|
||||
describe("workspace helpers", () => {
|
||||
it.effect("filterIgnoredPaths chunks large path lists and preserves kept paths", () =>
|
||||
Effect.gen(function* () {
|
||||
@@ -32,7 +32,7 @@ it.layer(Layer.empty)("GitVcsDriverLayer", (it) => {
|
||||
);
|
||||
|
||||
const seenChunks: string[][] = [];
|
||||
const layer = GitVcsDriverLayer.pipe(
|
||||
const layer = GitVcsDriver.layer.pipe(
|
||||
Layer.provideMerge(GitVcsDriverTestDependencies),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
Layer.provide(
|
||||
@@ -81,7 +81,7 @@ it.layer(Layer.empty)("GitVcsDriverLayer", (it) => {
|
||||
|
||||
it.effect("listWorkspaceFiles disables fsmonitor and untracked cache helpers", () =>
|
||||
Effect.gen(function* () {
|
||||
const layer = GitVcsDriverLayer.pipe(
|
||||
const layer = GitVcsDriver.layer.pipe(
|
||||
Layer.provideMerge(GitVcsDriverTestDependencies),
|
||||
Layer.provideMerge(NodeServices.layer),
|
||||
Layer.provide(
|
||||
|
||||
@@ -5,9 +5,9 @@ import { it, afterEach, describe, expect, vi } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, Path, PlatformError } from "effect";
|
||||
|
||||
import { ServerConfig } from "../../config.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts";
|
||||
import { VcsProcess } from "../../vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../../vcs/VcsProcess.ts";
|
||||
import { VcsProcess as VcsProcessService } from "../../vcs/VcsProcess.ts";
|
||||
import { WorkspaceEntries } from "../Services/WorkspaceEntries.ts";
|
||||
import { WorkspaceEntriesLive } from "./WorkspaceEntries.ts";
|
||||
import { WorkspacePathsLive } from "./WorkspacePaths.ts";
|
||||
@@ -15,8 +15,8 @@ import { WorkspacePathsLive } from "./WorkspacePaths.ts";
|
||||
const TestLayer = Layer.empty.pipe(
|
||||
Layer.provideMerge(WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive))),
|
||||
Layer.provideMerge(WorkspacePathsLive),
|
||||
Layer.provideMerge(VcsProcessLayer),
|
||||
Layer.provideMerge(GitVcsDriverLayer.pipe(Layer.provide(VcsProcessLayer))),
|
||||
Layer.provideMerge(VcsProcess.layer),
|
||||
Layer.provideMerge(GitVcsDriver.layer.pipe(Layer.provide(VcsProcess.layer))),
|
||||
Layer.provide(
|
||||
ServerConfig.layerTest(process.cwd(), {
|
||||
prefix: "t3-workspace-entries-test-",
|
||||
@@ -52,7 +52,7 @@ function writeTextFile(
|
||||
|
||||
const git = (cwd: string, args: ReadonlyArray<string>, env?: NodeJS.ProcessEnv) =>
|
||||
Effect.gen(function* () {
|
||||
const process = yield* VcsProcess;
|
||||
const process = yield* VcsProcessService;
|
||||
const result = yield* process.run({
|
||||
operation: "WorkspaceEntries.test.git",
|
||||
command: "git",
|
||||
|
||||
@@ -3,8 +3,8 @@ import { it, describe, expect } from "@effect/vitest";
|
||||
import { Effect, FileSystem, Layer, Path } from "effect";
|
||||
|
||||
import { ServerConfig } from "../../config.ts";
|
||||
import { layer as GitVcsDriverLayer } from "../../vcs/GitVcsDriver.ts";
|
||||
import { layer as VcsProcessLayer } from "../../vcs/VcsProcess.ts";
|
||||
import * as GitVcsDriver from "../../vcs/GitVcsDriver.ts";
|
||||
import * as VcsProcess from "../../vcs/VcsProcess.ts";
|
||||
import { WorkspaceEntries } from "../Services/WorkspaceEntries.ts";
|
||||
import { WorkspaceFileSystem } from "../Services/WorkspaceFileSystem.ts";
|
||||
import { WorkspaceEntriesLive } from "./WorkspaceEntries.ts";
|
||||
@@ -20,7 +20,7 @@ const TestLayer = Layer.empty.pipe(
|
||||
Layer.provideMerge(ProjectLayer),
|
||||
Layer.provideMerge(WorkspaceEntriesLive.pipe(Layer.provide(WorkspacePathsLive))),
|
||||
Layer.provideMerge(WorkspacePathsLive),
|
||||
Layer.provideMerge(GitVcsDriverLayer.pipe(Layer.provide(VcsProcessLayer))),
|
||||
Layer.provideMerge(GitVcsDriver.layer.pipe(Layer.provide(VcsProcess.layer))),
|
||||
Layer.provide(
|
||||
ServerConfig.layerTest(process.cwd(), {
|
||||
prefix: "t3-workspace-files-test-",
|
||||
|
||||
Reference in new issue
Block a user