Repository navigation
fix(cli): a media file referenced by its filesystem path goes into the cloud archive - #7381
Conversation
Edit accuracy: accurate 267 (base branch 267), smooth 90 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (2)
|
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 1 important · 0 nits · head 9c48060b
Checked
Checked the fails without the fix: claim: with main's publishProject.ts, the first two cases in publishProject.absolutePath.test.ts fail and the third passes. On this head, the publishProject suites pass (80 passed, 2 skipped). The returned archive path goes through referenceFrom, so a sub-composition at comp/c.html gets ../media/a.mp3 (probed). A root-relative URL that isn't on disk is still left as written. CI not read: this identity can't read check-runs.
| if (isPathInside(absPath, ctx.absProjectDir)) { | ||
| includeReferencedProjectFile(ctx, absPath, rawPath, requireOnDisk); | ||
| return null; | ||
| return filesystemPath ? relativeToProject(ctx, absPath) : null; |
There was a problem hiding this comment.
important: an in-project absolute path with a fragment or query gets the suffix encoded into the filename. I probed src="<project>/media/a.mp3#t=1" and it comes out as media/a.mp3%23t%3D1, a file that isn't in the archive, so the cloud render still can't find the audio. Media fragments (#t=) are common on <audio>/<video>. This isn't a regression: on main the absolute path also fails in the cloud. To fix it, split off ?…/#… before relativeToProject and append it after, with a case in publishProject.absolutePath.test.ts. The outside-project branch is unaffected, because existsSync misses and leaves the reference as written.
…e resolver is split
9c48060 to
aa5f2ed
Compare
There was a problem hiding this comment.
Verdict: APPROVE · 0 resolved, 0 open, 0 new · aa5f2ed → f8cdaa9
path.isAbsolute is the same as startsWith("/") on POSIX. On win32 it also accepts C:\…, C:/… and UNC, and rejects https:, data: and drive-relative C:rel. This matches the two windows-latest failures on aa5f2ed (job 128529378310: the inside-project and #fragment cases left C:\Users\… unrewritten). publishProject suites pass on Linux (81 passed, 2 skipped). Windows CI on this head is still running.
Port the adopted upstream fixes from f5bde95 to the current upstream tip: heygen-com#7375 multipart cloud upload, heygen-com#7382 minParallelChunks, heygen-com#7349 HLG header SEI, heygen-com#7369 skip unmounted compositions in lint/check, heygen-com#7381 filesystem-path media in the cloud archive, heygen-com#7383 Safari cut-point pre-roll revert, heygen-com#7373 clock steering between audio time updates, heygen-com#7384 injector test isolation, heygen-com#7378 preview seek retention, heygen-com#7390 virtual timer schedule per worker, heygen-com#7394 CDN script failure naming, heygen-com#7395 menu row radius, heygen-com#7119 decode timeout caller test, heygen-com#7397 authored tween order, heygen-com#7402 capture page clip loading, heygen-com#7412 muted video audio track at cuts, heygen-com#6150 template root variable test, heygen-com#7442 held tail seek once. Deliberate local differences: heygen-com#7067's audio-start hold is not carried into clock.ts, mountedSources comes from heygen-com#6827 as a helper only, cloud/_gen/types.ts omits the image-request types the fork does not generate, and the lint symlink test skips through symlinkOrSkip where the account cannot create links. Co-Authored-By: Claude Sonnet <[email protected]>
What
hyperframes cloud rendernow puts a media file that a composition references by its filesystem path (src="/Users/me/Music/song.mp3") into the upload archive, the way it already does for../media/song.mp3: the file is copied under_ext/and the reference is rewritten. A reference to a project file by its absolute path is rewritten to the file's path inside the archive.Why
A leading
/is a filesystem path to the local renderer (htmlCompiler.tsresolves it as one), so such a project renders with its audio locally. The archive builder treated every leading-/reference as a site URL and left it alone, the file was never uploaded, and the cloud renderer refuses a path starting with/(distributed/shared.ts:188). The render is then blocked withaudio_processing_failed: Source not found for audio element ...and the CLI never warned.How
tryResolveExternalinutils/publishProject.tsnow resolves a single-leading-/reference as a filesystem path: outside the project and present on disk it is archived under_ext/(the existingaddExternalAsset); inside the project it is rewritten to its archive path. A Windows drive-letter path (C:\\...) counts as a filesystem path too (path.isAbsolute). A reference that does not exist on disk (a root-relative site URL such as/assets/x.png) is left as written, as before.Test plan
utils/publishProject.absolutePath.test.ts: an absolute path outside the project is archived under_ext/and rewritten; one inside is rewritten to its project path; a missing one is left alone. fails without the fix: the first two fail on main (the reference and the archive are unchanged).The
publishProjectsuites pass (80 tests), on Linux.Real check through the archive builder: an audio
srcof an absolute path outside the project gave an archive ofindex.htmlandhyperframes.jsononly before, and_ext/media/song.mp3withsrc="_ext/media/song.mp3"after. Local render of the same project is unchanged (audio present).Unit tests added/updated
Manual testing performed
Documentation updated (not applicable)
Comments follow CONTRIBUTING.md "Comments"
Not exercised: a real cloud render of the archive, CSS
url()with an absolute path (it goes through the same function, not separately tested), the#fragment/?querykept after the archive path is tested for HTML only, a real Windows run beyond CI (the new tests usejoinof the temp folders, so they take the drive-letter form there).