Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): capture checkpoints before refreshing PR status #10347

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/10347/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 64 additions and 3 deletions.

x
0 of 2 viewed, 2 left
45 additions and 1 deletionapps/server/src/orchestration/Layers/CheckpointReactor.test.tsModified
View file
@@ -302,6 +302,7 @@
readonly providerName?: ProviderDriverKind;
readonly gitStatusRefreshCalls?: Array<string>;
readonly pullRequestRefreshCalls?: Array<string>;
+ readonly pullRequestRefresh?: Effect.Effect<void>;
}) {
const cwd = createGitRepository();
if (options?.initializeGit === false) {
@@ -357,7 +358,7 @@
refreshPullRequestStatus: (cwd: string) =>
Effect.sync(() => {
options?.pullRequestRefreshCalls?.push(cwd);
- }).pipe(Effect.as(null)),
+ }).pipe(Effect.andThen(options?.pullRequestRefresh ?? Effect.void), Effect.as(null)),
streamStatus: () => Stream.empty,
});
​
@@ -879,6 +880,49 @@
expect(pullRequestRefreshCalls).toEqual([harness.cwd]);
});
​
+ effectIt.effect("captures files while the pull request lookup is still pending", () =>
+ Effect.gen(function* () {
+ const lookupStarted = yield* Deferred.make<void>();
+ const finishLookup = yield* Deferred.make<void>();
+ const harness = yield* Effect.promise(() =>
+ createHarness({
+ seedFilesystemCheckpoints: false,