Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(pull-requests): shared state + not settling? #9332

Mergedmaria-rcksmerged 11 commits intomain fromrefs/pull/9332/headmerged by maria-rcks View on GitHub

Showing 9 changed files with 96 additions and 9 deletions (loading 7).

x
0 of 9 viewed, 9 left
71 additions and 3 deletionsapps/server/src/orchestration/ThreadSettlementReactor.test.tsModified
View file
@@ -25,7 +25,10 @@
import { TestClock } from "effect/testing";
​
import { GitManager } from "../git/GitManager.ts";
-import { PullRequestService } from "../pullRequest/PullRequestService.ts";
+import {
+ PullRequestService,
+ type PullRequestMergeEvent,
+} from "../pullRequest/PullRequestService.ts";
import { ServerActivation } from "../serverActivation.ts";
import { ServerSettingsService } from "../serverSettings.ts";
import { OrchestrationCommandInvariantError } from "./Errors.ts";
@@ -143,6 +146,7 @@
const snapshotReads = yield* Queue.unbounded<number>();
const settings = yield* Ref.make(options.settings ?? DEFAULT_SERVER_SETTINGS);
const settingsChanges = yield* PubSub.unbounded<ServerSettings>();
+ const mergedPullRequests = yield* PubSub.unbounded<PullRequestMergeEvent>();
const commands = yield* Ref.make<ReadonlyArray<AutoSettleCommand>>([]);
const branchCalls = yield* Ref.make<
ReadonlyArray<{ readonly cwd: string; readonly branch: string }>
@@ -168,7 +172,6 @@
Ref.update(branchCalls, (calls) => [...calls, input]).pipe(
Effect.andThen(options.branchPullRequest?.(input) ?? Effect.succeed(null)),
-​
const pullRequestSummary: PullRequestService["Service"]["summary"] = (input, readOptions) =>
Effect.gen(function* () {
yield* Ref.update(summaryCalls, (calls) => [...calls, input]);