Repository navigation
fix(cli): media-treatment reads a relative --grading file from the project folder - #6964
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 6c503203
Scope
- Read the full diff and
utils/jsonFlag.ts. Inline JSON and-(stdin) return beforereadFileis called.resolve(projectDir, path)leaves absolute paths, including Windows drive paths, unchanged. --filealready resolves againstproject.dir(media-treatment.ts:678).--gradingis the only JSON-file flag in media-treatment, so there are no other call sites to fix.- The test named on the
fails without the fix:line runs with--project <tmp>while the working directory is somewhere else, soassets/g.jsonfails with ENOENT without the fix. - CI on this head was still running (CI, CodeQL, Windows, preview-regression); the required checks still gate the merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
hyperframes media-treatment --file compositions/<scene>.html --grading assets/<grade>.json --applyfailed withENOENTon a path under the folder the command runs in.--fileis read from the project folder, but a relative--gradingfile was read from the current directory, so a command launched from anywhere but the project (an app's install folder) never found it.A relative
--gradingpath is now read from the project folder, the same as--file. Absolute paths, inline JSON and-for stdin are unchanged. Run inside the project (the usual case), nothing changes.Why
Reported against 0.8.228 on Windows; reproduced on 0.8.230 with
--project <dir>run from another folder:ENOENT ... open '<cwd>/assets/g.json'.Test
New test: a relative
--gradingfile is read from the--projectfolder. The existing grading-file tests still pass; 50 tests, 3 runs in a row.fails without the fix: packages/cli/src/commands/media-treatment.test.ts › applyMediaTreatmentToHtml › reads a relative --grading file from the project, not from where the command runs
Size
Under 100 changed lines.