New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix yarn list --json
stdOut parsing. fixes #388
#516
Fix yarn list --json
stdOut parsing. fixes #388
#516
Conversation
3f19dde
to
c049836
Compare
Sorry had to fixup this PR a few times and had to temporarily disable prettier from .lintstaged because of #515 |
All rebased on master and ready to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, but finally I got time to review the changes completely.
There might be one issue which changes the behavior of the parsing: If you pass an invalid JSON, previously it rejected with an error and stopped. Now you return null
and the deployment will continue but without dependencies, eventually leading to a broken service.
Is this intended, or is there a specific reason for the behavior?
@HyperBrain The JSON parsing is now line by line and some lines may be blank which causes a parsing error. It's be possible to change the code to filter out these blank lines before parsing and to throw on invalid json. I'm fine with either approach if you prefer one over the other. I think that more important point you raise is that we should be throwing a more meaningful error if we cannot find a line where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me.
What did you implement:
Closes #388
How did you implement it:
Yarn outputs a JSON lines to represent it's output when using the
--json
flag. This PR simply parses each line and looks for the correcttree
JSON line and passes it to theconvertTrees
step.How can we verify it:
Run tests or run a build that's using yarn the extra lines are alway output if yarn needs to install anything.
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO