Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): stop re-running git for every project each minute #13689

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/13689/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 5 changed files with 65 additions and 5 deletions (loading 2).

x
0 of 5 viewed, 5 left
45 additions and 0 deletionsapps/server/src/orchestration/ThreadPullRequestReactor.test.tsModified
View file
@@ -406,6 +406,51 @@
​
+ it.effect("refreshes the project identity when a turn adds the remote", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const current = thread("new-remote");
+ const fixture = yield* makeHarness({
+ threads: [current],
+ project: { ...project, repositoryIdentity: null },
+ branchPullRequest: () => Effect.succeed(branchPullRequest()),
+ resolveRepositoryIdentity: (_cwd, options) =>
+ Effect.succeed(options?.refresh ? project.repositoryIdentity : null),
+ });
+ yield* Effect.gen(function* () {
+ const reactor = yield* fixture.start();
+ expect(yield* Ref.get(fixture.commands)).toHaveLength(0);
+​
+ yield* fixture.publish({
+ type: "thread.turn-diff-completed",
+ sequence: 2,
+ eventId: EventId.make("checkpoint-finished"),
+ aggregateKind: "thread",
+ aggregateId: current.id,
+ occurredAt: NOW,
+ commandId: null,
+ causationEventId: null,
+ correlationId: null,
+ metadata: {},