fix(migrate): gate automatic source discovery

This commit is contained in:
Mohamed Boudra
2026-07-19 01:21:02 +02:00
parent faccbaae59
commit a8c6c2f4bc
3 changed files with 3 additions and 23 deletions
@@ -12,7 +12,7 @@ import { resolveMigrationEntrypoint } from "./entrypoint.js";
import { DesktopMigrationProcess, type MigrationTarget } from "./process.js";
const migrations = new DesktopMigrationProcess({
sources: new Map([["conductor", ["conductor"]]]),
sources: new Map(process.platform === "darwin" ? [["conductor", ["conductor"]]] : []),
env: process.env,
resolveEntrypoint: resolveMigrationEntrypoint,
createInvocation: ({ entrypoint, args, env }) =>
@@ -138,6 +138,7 @@ test("does not rewrite literal or escaped Conductor variables", () => {
setup: "printf '%s\\n' '$CONDUCTOR_WORKSPACE_PATH'",
run: {
escaped: { command: "printf \\$CONDUCTOR_PORT" },
escapedDouble: { command: 'printf "\\$CONDUCTOR_PORT"' },
active: { command: "printf \"'$CONDUCTOR_PORT'\"" },
},
},
@@ -150,6 +151,7 @@ test("does not rewrite literal or escaped Conductor variables", () => {
expect.arrayContaining([
"worktree.setup: Literal or escaped Conductor variables: CONDUCTOR_WORKSPACE_PATH. Command was not imported.",
"scripts.escaped: Literal or escaped Conductor variables: CONDUCTOR_PORT. Command was not imported.",
"scripts.escapedDouble: Literal or escaped Conductor variables: CONDUCTOR_PORT. Command was not imported.",
]),
);
});
@@ -310,28 +310,6 @@ describe.skipIf(isPlatform("win32"))("worktree POSIX-only", () => {
expect((caughtError as BranchAlreadyCheckedOutError).branchName).toBe("main");
});
it("prunes a verified stale registration before checking out its branch", async () => {
execFileSync("git", ["branch", "stale-branch"], { cwd: repoDir });
const stalePath = join(tempDir, "stale-worktree");
execFileSync("git", ["worktree", "add", stalePath, "stale-branch"], { cwd: repoDir });
rmSync(stalePath, { recursive: true, force: true });
const recreated = await createLegacyWorktreeForTest({
cwd: repoDir,
worktreeSlug: "recreated-stale",
source: { kind: "checkout-branch", branchName: "stale-branch" },
runSetup: false,
paseoHome,
});
expect(existsSync(recreated.worktreePath)).toBe(true);
expect(
execFileSync("git", ["branch", "--show-current"], { cwd: recreated.worktreePath })
.toString()
.trim(),
).toBe("stale-branch");
});
it("fetches a GitHub PR branch, checks it out, writes metadata, and runs setup", async () => {
const remoteDir = join(tempDir, "remote.git");
const remoteCloneDir = join(tempDir, "remote-clone");