GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): storage cleanup keeps worktrees whose file listing excee… · pingdotgg/t3code@bc8583b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src
    • storageCleanup.test.ts
    • storageCleanup.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/storageCleanup.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/storageCleanup.test.ts
+30Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,6 +2678,36 @@ describe("storage cleanup reports and local file policies", () => {
26782678
}),
26792679
),
26802680
);
2681+
it.live.each([
2682+
["uncommitted-changes", "untracked", "Local changes exceed the inspection limit"],
2683+
["any-local-files", "ignored", "Ignored files exceed the inspection limit"],
2684+
] as const)(
2685+
"keeps a worktree under %s when its %s file listing exceeds the inspection limit",
2686+
([policy, kind, reason]) =>
2687+
runCleanupTest(
2688+
Effect.gen(function* () {
2689+
const { service, fs, worktree, setPolicy } = yield* cleanupFixture();
2690+
setPolicy(policy);
2691+
const files = Array.from({ length: 3000 }, (_, i) =>
2692+
kind === "untracked"
2693+
? `${worktree}/many/untracked-file-with-a-long-name-${i}.txt`
2694+
: `${worktree}/many/ignored-directory-with-a-long-name-${i}/.env`,
2695+
);
2696+
yield* fs.makeDirectory(`${worktree}/many`);
2697+
yield* Effect.forEach(
2698+
files,
2699+
(file) =>
2700+
Effect.gen(function* () {
2701+
if (kind === "ignored") yield* fs.makeDirectory(file.slice(0, -"/.env".length));
2702+
yield* fs.writeFileString(file, "local\n");
2703+
}),
2704+
{ concurrency: 64, discard: true },
2705+
);
2706+
expect((yield* service.runNow).entries[0]).toMatchObject({ outcome: "kept", reason });
2707+
expect(yield* fs.exists(files[0]!)).toBe(true);
2708+
}),
2709+
),
2710+
);
26812711
it.live("serializes concurrent requests and returns each run's report", () =>
26822712
runCleanupTest(
26832713
Effect.gen(function* () {
Collapse file

‎apps/server/src/storageCleanup.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/storageCleanup.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ const make = Effect.gen(function* () {
654654
: "--untracked-files=all",
655655
],
656656
maxOutputBytes: 64 * 1024,
657+
appendTruncationMarker: true,
657658
});
658659
if (status.stdoutTruncated) return "local changes exceed the inspection limit";
659660
const records = status.stdout.split("\0").filter(Boolean);
@@ -669,6 +670,7 @@ const make = Effect.gen(function* () {
669670
cwd,
670671
args: ["ls-files", "--others", "--ignored", "--exclude-standard", "--directory", "-z"],
671672
maxOutputBytes: 64 * 1024,
673+
appendTruncationMarker: true,
672674
});
673675
if (ignored.stdoutTruncated) return "ignored files exceed the inspection limit";
674676
const file = ignored.stdout

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.