Repository navigation
feat(cli): check_report counts the browser-playable copies a check waited for - #7316
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 2 blocker · 1 important · 0 nits · head 5cbc9a13
- blocker: required
Commentscheck fails at this head:checkTypes.tscomment share rises 8.2% (38/465 → 39/473); the PR body doesn't mention it. ↓ inline - blocker: the new partial flips
browserSkippedto false on the exact stop this PR targets. ↓ inline - important:
copies_unfinishedalso counts copies that failed. ↓ inline
Scope
Read all 5 files at head, plus checkDeadline.ts (keepPartial/partialResult), checkPipeline.ts catch path (L1748–1751) and commands/check.ts browserSkipped consumers. The PR names a test that fails without the fix (events.test.ts), which covers the event mapping only. Nothing exercises the stop path end to end.
| const html = await loadCheckHtmlWithDeferredMedia(project.dir); | ||
| deadline?.enter("copies"); | ||
| let mediaCopies: MediaCopyFacts | undefined; | ||
| deadline?.keepPartial(() => (mediaCopies ? { mediaCopies } : {})); |
There was a problem hiding this comment.
blocker: when the copy wait throws CheckCopiesUnfinishedError, checkPipeline.ts:1750 builds skipped: Object.keys(found).length === 0 from the partial. found is now { mediaCopies }, so browserSkipped becomes false even though Chrome never launched. The human report then drops the "Browser session never ran — … empty placeholders, not a clean pass" warning (commands/check.ts:688), and the JSON report and artifact metadata show browserSkipped: false over empty layout/motion/contrast sections.
Fix: carry mediaCopies outside keepPartial, or have line 1750 ignore mediaCopies when deciding skipped. Then add a check.test.ts case where runBrowserCheck reports copy facts and then throws CheckCopiesUnfinishedError, asserting browserSkipped === true and that copies_* are sent.
| const unfinished = sources.flatMap(({ file }, index) => | ||
| results[index]!.status === "rejected" ? [`${file} ${heartbeat.percent(index)}`] : [], | ||
| ); | ||
| record?.({ total, waitedMs: Date.now() - startedAt, unfinished: unfinished.length }); |
There was a problem hiding this comment.
important: unfinished counts every rejected result, including copies that ffmpeg failed on (lines 341–344 handle those as warnings when the budget isn't hit). So a check that finishes normally with 2 failed copies sends copies_unfinished: 2. That mixes slow or stuck copies with broken ones, which is the distinction this field exists for. Count only the rejections caused by the abort, or send failures as their own field.
| overlapMs: number; | ||
| } | ||
|
|
||
| /** What a check's browser-playable copies cost: videos, ms waited, videos not done. */ |
There was a problem hiding this comment.
blocker (CI): this line makes the required Comments check fail (RAISED comment share: checkTypes.ts 8.2% (39/473), base 8.2% (38/465)). The field names already say what the doc comment says. Drop the comment, or cut one elsewhere in the file.
…t only abort-caused unfinished
|
Head a523981: the doc comment on checkTypes.ts is dropped (Comments check); the catch path ignores mediaCopies when deciding browserSkipped, with a check.test.ts case for the copy-wait stop (copy facts sent, browserSkipped true); copies_unfinished is 0 unless the budget stopped the wait, so ffmpeg-failed copies are not counted. The red/green run for the new test is running on a loaded box; I will post it. |
There was a problem hiding this comment.
Verdict: APPROVE — 3 resolved, 0 open, 0 new · 5cbc9a13 → a523981f
Comments now passes. With mediaCopies left out of the skipped count, the copy-wait stop reads browserSkipped: true, and the new check.test.ts case fails without that change. unfinished is zeroed unless the budget fired. The rest of CI was still running when I approved, so required checks still gate the merge.
|
Run on a Linux box (bun install, build, vitest): the new check.test.ts case "a check stopped by the copy wait still sends the copy facts and stays browserSkipped" fails with the previous head's checkPipeline.ts (1 failed), and events.test.ts plus check.test.ts pass with this head (247). |
There was a problem hiding this comment.
Verdict: APPROVE — 0 resolved, 0 open, 0 new · a523981f → 6acbc419
Only formatting changed, in the two test files. CI, preview-regression, Comments and CodeQL pass on this head. The earlier preview-regression red came from the format preflight, not from main. Windows render verification was still running; it also fails on main at 410a516c (engine-cli-1).
…view to heygen-com#7250 Adopts heygen-com#7310 (MPEG-4 Part 2 / MJPEG get browser-playable copies), heygen-com#7316 (check_report counts the copies a check waited for) and heygen-com#7317 (render reads a composition src like the preview and refuses paths outside the project). Defers heygen-com#7309 (needs heygen-com#6912); heygen-com#7314 does not apply. PR axis advances to heygen-com#7250 (heygen-com#7243 closed unmerged, heygen-com#7249 open and pinned as monitored; monitored 96->97). Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changed
check_reportgainscopies_total,copies_waited_msandcopies_unfinished, sent only when the project had videos Chrome cannot decode: how many there were, how long the check waited for their browser-playable copies, and how many were still not done when the wait budget stopped it (copies ffmpeg failed on in a normal run are not counted). Counts and milliseconds only, no names or paths.preResolveHostileMediaProxiesreports the numbers through a callback just before it may throwCheckCopiesUnfinishedError,runBrowserCheckkeeps them as a partial result, so a check that stopped on the copy wait still sends them.Why
A check that stops with
media_copies_unfinishedcannot be counted today: the event has no copies facts, andstop_code(#7305) says only that it stopped. Whether the wait is stuck or just slow on many large videos is not answerable from the data.What I measured
CheckCopiesUnfinishedError; with the earlier head's pipeline it read browserSkipped false), and packages/cli/src/telemetry/events.test.ts "sends what making browser-playable copies cost as counts and milliseconds, and omits it without videos" (withevents.tsat main it fails; 1 failed, 82 passed). With the change that file andcommands/check.test.tspass (246).What I did NOT exercise
tscon the box printed errors for@hyperframes/inspector/live(not built in that tree), none in the lines this changes.Size
About 30 changed lines in 5 files: a lone telemetry addition; nothing open on this event to carry it.