diff --git a/.changeset/migrate-run-folder-once.md b/.changeset/migrate-run-folder-once.md new file mode 100644 index 000000000..86021179e --- /dev/null +++ b/.changeset/migrate-run-folder-once.md @@ -0,0 +1,5 @@ +--- +"clerk": patch +--- + +`clerk migrate import` prints the run's ID and folder once, as the import starts, instead of again at the end of the summary. `clerk migrate` is still experimental and needs `CLERK_EXPERIMENTAL=migrate`. diff --git a/packages/cli-core/src/commands/migrate/run.test.ts b/packages/cli-core/src/commands/migrate/run.test.ts index 345fbe0e2..4206732d1 100644 --- a/packages/cli-core/src/commands/migrate/run.test.ts +++ b/packages/cli-core/src/commands/migrate/run.test.ts @@ -30,6 +30,7 @@ import { listRuns, patchRun, readRun, + runDir, sha256File, startRun, importLockFile, @@ -1325,6 +1326,19 @@ describe("run", () => { expect(created()).toHaveLength(0); }); + // Printed as the import starts, for a Ctrl-C; the summary doesn't repeat it. + test("names the run folder once", async () => { + stubClerk(); + + await run(baseOptions); + + const [record] = listRuns(runsDir()); + expect(record).toBeDefined(); + const line = `Run ${record!.id}: ${runDir(runsDir(), record!.id)}`; + expect(captured.err).toContain(line); + expect(captured.err.split(line)).toHaveLength(2); + }); + test("exits 1 when some users failed", async () => { stubClerk({ failing: new Set(["u2"]) }); diff --git a/packages/cli-core/src/commands/migrate/run.ts b/packages/cli-core/src/commands/migrate/run.ts index 7cb522091..1dab4d50e 100644 --- a/packages/cli-core/src/commands/migrate/run.ts +++ b/packages/cli-core/src/commands/migrate/run.ts @@ -680,7 +680,6 @@ function formatSummary( summary: ImportSummary, skipped: number, record: RunRecord, - runFolder: string, instanceType: InstanceType, ): string[] { const lines = [ @@ -719,7 +718,6 @@ function formatSummary( } const explained = [...summary.errorBreakdown.keys(), ...summary.droppedPhones.keys()]; for (const note of explainErrors(explained, instanceType)) lines.push("", note); - lines.push("", dim(`Run ${record.id}: ${runFolder}`)); return lines; } @@ -1594,7 +1592,6 @@ async function runImport(rawOptions: MigrateRunOptions, lock: ImportLock): Promi summary, checks.rejects.length + checks.skipped.length + withoutPassword.length, record, - run.dir, limits.instanceType, )) { log.info(line);