Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): idle status polls and PR sweeps start fewer git processes #16272

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

Showing 4 changed files with 61 additions and 13 deletions (loading 2).

x
0 of 4 viewed, 4 left
43 additions and 0 deletionsapps/server/src/git/GitManager.test.tsModified
View file
@@ -1071,6 +1071,49 @@
+ it.effect("a branch tracking origin reads origin's URL once per PR lookup", () =>
+ Effect.gen(function* () {
+ const repoDir = yield* makeTempDir("t3code-git-manager-");
+ yield* initRepo(repoDir);
+ const remoteDir = yield* createBareRemote();
+ yield* runGit(repoDir, ["remote", "add", "origin", remoteDir]);
+ yield* runGit(repoDir, ["checkout", "-b", "feature/origin-once"]);
+ yield* runGit(repoDir, ["push", "-u", "origin", "feature/origin-once"]);
+​
+ const gitConfigReads: string[] = [];
+ const { manager } = yield* makeManager({
+ gitConfigReads,
+ ghScenario: {
+ prListSequence: [
+ // Fake gh returns raw JSON stdout, matching the CLI boundary under test.
+ // @effect-diagnostics-next-line preferSchemaOverJson:off
+ JSON.stringify([
+ {
+ number: 217,
+ title: "Origin once PR",
+ url: "https://github.com/pingdotgg/t3code/pull/217",
+ baseRefName: "main",
+ headRefName: "feature/origin-once",
+ state: "OPEN",
+ updatedAt: "2026-04-03T15:00:00Z",
+ },