Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): a checkpoint capture starts 8 git processes instead of 10 #21315

Mergedjosephv123(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/21315/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 169 additions and 9 deletions.

x
0 of 2 viewed, 2 left
120 additions and 0 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -914,6 +914,126 @@
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
​
+const captureRecordingGitCommands = Effect.fn("test.captureRecordingGitCommands")(function* (
+ cwd: string,
+ checkpointRef: CheckpointRef,
+) {
+ const liveProcess = yield* VcsProcess.VcsProcess;
+ const commands: Array<string | undefined> = [];
+ const driver = yield* GitVcsDriver.makeVcsDriverShape().pipe(
+ Effect.provideService(VcsProcess.VcsProcess, {
+ run: (input) => {
+ let index = 0;
+ while (input.args[index] === "-C" || input.args[index] === "-c") index += 2;
+ commands.push(input.args[index]);
+ return liveProcess.run(input);
+ },
+ }),
+ );
+ yield* driver.checkpoints.captureCheckpoint({ cwd, checkpointRef });
+ return commands;
+});
+​
+it.effect.each(["committed", "unborn"] as const)(
+ "checkpoint capture reads the repository with one rev-parse (HEAD=%s)",
+ (head) =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;