History

pr-media prefers film.mp4 — the whole session, not just the browser hop

Rhys Sullivan committed 5 months ago

Commit 7eca7ab1 parent 30e118d1 file · +8 −4Browse files

Unified · Split

e2e/scripts/pr-media.ts+8−4
@@ -8,8 +8,9 @@ · 7 unmodified lines
88 // the PR description.
99 //
1010 // Usage: bun e2e/scripts/pr-media.ts <run-dir-or-artifact> [...more]
11−// run dir e2e/runs/<target>/<scenario-slug> — picks session.mp4 or
12−// terminal.cast and labels the gif from result.json
11+// run dir e2e/runs/<target>/<scenario-slug> — picks film.mp4 (the
12+// whole session), else session.mp4, else terminal.cast;
13+// labels the gif from result.json
1314 // session.mp4 browser recording (ffmpeg -> gif)
1415 // terminal.cast terminal recording (agg -> gif; brew install agg)
1516 // *.png run screenshot, uploaded as-is
@@ -48,10 +49,13 @@ const resolveArtifact = (input: string): Artifact => { · 32 unmodified lines
4849 slug: basename(path).replace(/\.[^.]+$/, ""),
4950 };
5051 }
51− const recording = ["session.mp4", "terminal.cast"]
52+ // film.mp4 (scripts/film.ts) is the whole session — terminal chat AND the
53+ // browser hop, cut in time order; the bare browser session.mp4 is only the
54+ // hop, so it must never win when a film exists.
55+ const recording = ["film.mp4", "session.mp4", "terminal.cast"]
5256 .map((name) => join(path, name))
5357 .find(existsSync);
54− if (!recording) throw new Error(`${input} has no session.mp4 or terminal.cast`);
58+ if (!recording) throw new Error(`${input} has no film.mp4, session.mp4, or terminal.cast`);
5559 let label = basename(path);
5660 try {
5761 const result = JSON.parse(readFileSync(join(path, "result.json"), "utf8")) as {