Skip to content

Commit 21d4399

Browse files
fix(server): type mounted PR test scenarios and accept resolved /tmp in fixture seeder
Annotate the mounted Forgejo PR test scenarios as FakeGhScenario so their state literal no longer widens to string (TS2322/TS2345 in CI typecheck). The PR handoff fixture seeder now compares the resolved root against the resolved /tmp, so macOS's /private/tmp passes, and rejects /tmp itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7ec918e commit 21d4399

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎apps/server/src/git/GitManager.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4832,7 +4832,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
48324832
yield* runGit(repoDir, ["checkout", "main"]);
48334833
yield* runGit(repoDir, ["branch", "-D", "feature/fork-only"]);
48344834

4835-
const ghScenario = {
4835+
const ghScenario: FakeGhScenario = {
48364836
pullRequest: {
48374837
number: 82,
48384838
title: "Fork-only PR",
@@ -4900,7 +4900,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
49004900
forkDir,
49014901
);
49024902

4903-
const ghScenario = {
4903+
const ghScenario: FakeGhScenario = {
49044904
pullRequest: {
49054905
number: 82,
49064906
title: "Fork-only PR",

‎scripts/fixtures/pr-handoff/seed-repositories.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import json, os, pathlib, subprocess
44
fixture = json.loads(pathlib.Path(__file__).with_name('fixture.json').read_text())
55
root = pathlib.Path(fixture['root']).resolve()
6-
if not str(root).startswith('/tmp/'):
6+
tmp = pathlib.Path('/tmp').resolve()
7+
if root == tmp or tmp not in root.parents:
78
raise SystemExit('Set fixture.json root to an isolated directory below /tmp.')
89
paths = [root / project['directory'] for project in fixture['projects']]
910
if any(path.exists() for path in paths):

0 commit comments

Comments
 (0)