Skip to content

Commit bb196b3

Browse files
donjorrsi-pr-agent
authored andcommitted
test(upstream-fixes): fork ingestor tests provide upstream's GitVcsDriver (pingdotgg#20079) and CommandOutputHub (pingdotgg#15094)
Fork-Domain: upstream-fixes Fork-Tier: bugfix Fork-Upstreamable: no
1 parent 40e475e commit bb196b3

4 files changed

Lines changed: 31 additions & 9 deletions

File tree

‎apps/server/src/orchestration-v2/ProviderSessionManager.fork.test.ts‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
4343
import * as McpProviderSessions from "@t3tools/provider-core/server/McpProviderSessions";
4444
import * as McpSessionRegistry from "../mcp/McpSessionRegistry.ts";
4545
import * as SqlitePersistence from "../persistence/Sqlite.ts";
46+
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
4647
import * as ServerSettings from "../serverSettings.ts";
4748
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
49+
import * as CommandOutputHub from "./CommandOutputHub.ts";
4850
import * as EventSink from "./EventSink.ts";
4951
import * as EventStore from "./EventStore.ts";
5052
import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
@@ -115,7 +117,7 @@ const layerFlakyProjectionReads = (flaky: FlakyProjectionReads) =>
115117
Effect.gen(function* () {
116118
if (yield* Ref.getAndSet(flaky.armed, false)) {
117119
yield* Queue.offer(flaky.failures, undefined);
118-
return yield* Effect.fail(new ProjectionStore.ProjectionStoreReadError({ threadId }));
120+
return yield* new ProjectionStore.ProjectionStoreReadError({ threadId });
119121
}
120122
return yield* delegate.getThreadRecords(threadId, fields, filter);
121123
});
@@ -211,12 +213,10 @@ const layerTest = (input: {
211213
startTurn: () => Effect.die("unused"),
212214
steerTurn: () => Effect.void,
213215
interruptTurn: ({ providerTurnId }) =>
214-
Effect.gen(function* () {
215-
yield* Ref.update(input.state, (current) => ({
216-
...current,
217-
interruptedTurnIds: [...current.interruptedTurnIds, providerTurnId],
218-
}));
219-
}),
216+
Ref.update(input.state, (current) => ({
217+
...current,
218+
interruptedTurnIds: [...current.interruptedTurnIds, providerTurnId],
219+
})),
220220
unloadThread: ({ providerThread }) =>
221221
Effect.gen(function* () {
222222
yield* Ref.update(input.state, (current) => ({
@@ -253,6 +253,9 @@ const layerTest = (input: {
253253
IdAllocator.layer,
254254
layerTestStores,
255255
ThreadCommandExecutor.layer,
256+
Layer.mock(GitVcsDriver.GitVcsDriver)({
257+
resolveBranchName: () => Effect.succeed(null),
258+
}),
256259
),
257260
),
258261
);
@@ -268,6 +271,9 @@ const layerTest = (input: {
268271
ProviderAdapterRegistry.layerFromAdapters([adapter]).pipe(
269272
Layer.provideMerge(McpProviderSessions.layer),
270273
),
274+
CommandOutputHub.layer.pipe(
275+
Layer.provide(Layer.merge(layerConfiguredEventSink, layerTestStores)),
276+
),
271277
layerConfiguredEventSink,
272278
IdAllocator.layer,
273279
layerProviderEventIngestorTest,

‎apps/server/src/orchestration-v2/RunExecutionService.ownerFence.fork.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ import * as Ref from "effect/Ref";
3232
import * as Stream from "effect/Stream";
3333

3434
import * as SqlitePersistence from "../persistence/Sqlite.ts";
35+
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
3536
import * as McpAppModelContext from "../mcpApps/McpAppModelContext.ts";
37+
import * as PreviewAgentActivity from "../preview/PreviewAgentActivity.ts";
3638
import * as ServerSettings from "../serverSettings.ts";
3739
import * as CheckpointService from "./CheckpointService.ts";
3840
import * as EventSink from "./EventSink.ts";
@@ -348,6 +350,9 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") {
348350
ingestionProjections,
349351
IdAllocator.layer,
350352
ThreadCommandExecutor.layer,
353+
Layer.mock(GitVcsDriver.GitVcsDriver)({
354+
resolveBranchName: () => Effect.succeed(null),
355+
}),
351356
),
352357
),
353358
);
@@ -358,6 +363,7 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") {
358363
ingestion,
359364
IdAllocator.layer,
360365
McpAppModelContext.layerEmpty,
366+
PreviewAgentActivity.layer,
361367
ServerSettings.layerTest(),
362368
Layer.mock(TurnItemPositionStore.TurnItemPositionStoreV2)({
363369
allocate: () => Effect.succeed(1),
@@ -474,7 +480,7 @@ function fixture(gate: "snapshot" | "cascade" | "nested" | "model") {
474480
const send = (event: ProviderAdapterV2Event) =>
475481
publish(event).pipe(
476482
Effect.flatMap((acks) =>
477-
Effect.all([...acks.values()].map(Deferred.await), { concurrency: "unbounded" }),
483+
Effect.forEach([...acks.values()], Deferred.await, { concurrency: "unbounded" }),
478484
),
479485
);
480486
return { start, publish, send, projections, history, sink, entered, release, closures, closed };

‎apps/server/src/orchestration-v2/RunExecutionService.transfer.fork.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import type {
4242
} from "@t3tools/provider-core/server/ProviderAdapter";
4343
import * as ProjectionStore from "./ProjectionStore.ts";
4444
import * as ProviderEventIngestor from "./ProviderEventIngestor.ts";
45+
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
4546
import * as RunExecutionService from "./RunExecutionService.ts";
4647
import * as TurnItemPositionStore from "./TurnItemPositionStore.ts";
4748
import * as ThreadCommandExecutor from "./ThreadCommandExecutor.ts";
@@ -285,6 +286,9 @@ function twoSubscriptions(
285286
Effect.succeed({ nodes: [], turnItems: [], runtimeRequests: [] }),
286287
}),
287288
Layer.mock(ThreadCommandExecutor.ThreadCommandExecutor)({}),
289+
Layer.mock(GitVcsDriver.GitVcsDriver)({
290+
resolveBranchName: () => Effect.succeed(null),
291+
}),
288292
),
289293
),
290294
);

‎apps/server/src/zmux/CheckoutSessionStateLease.fork.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
2626
import * as ProviderEventIngestor from "../orchestration-v2/ProviderEventIngestor.ts";
2727
import * as ThreadCommandExecutor from "../orchestration-v2/ThreadCommandExecutor.ts";
2828
import * as SqlitePersistence from "../persistence/Sqlite.ts";
29+
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
2930
import * as ProjectEnrichment from "../project/ProjectEnrichmentService.ts";
3031
import * as ProjectService from "../project/ProjectService.ts";
3132
import * as ServerSettings from "../serverSettings.ts";
@@ -62,7 +63,12 @@ const dependencies = Layer.merge(core, LegacyImporter.layer.pipe(Layer.provide(c
6263
const testLayer = Layer.mergeAll(
6364
dependencies,
6465
ProjectService.layer.pipe(Layer.provide(dependencies)),
65-
ProviderEventIngestor.layer.pipe(Layer.provide(dependencies)),
66+
ProviderEventIngestor.layer.pipe(
67+
Layer.provide(dependencies),
68+
Layer.provide(
69+
Layer.mock(GitVcsDriver.GitVcsDriver)({ resolveBranchName: () => Effect.succeed(null) }),
70+
),
71+
),
6672
);
6773

6874
it.effect("ordinary mutations remain concurrent; pending cleanup excludes later mutations", () =>

0 commit comments

Comments
 (0)