-
Notifications
You must be signed in to change notification settings - Fork 124
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
Reject packages that do not have path. #170
Reject packages that do not have path. #170
Conversation
This could happen for `package.json` files for which `npm` correctly shows an error, but `yarn` works with them just fine.
👋 @krzysztof-pawlik-gat thanks for opening this up! I'm not terribly familiar with I'm hesitant about this approach because it's either hiding an error that could be reported to the user or it's hiding a second version of a dependency used in the product. For full dependency reporting both the top level version of
I took a quick look at a yarn source a few months ago and couldn't find a way to easily enumerate all the information that licensed needs. If you're familiar with the yarn CLI and how to pull package metadata and license information I would gladly accept a PR for this. |
This is not exactly
But it continues and installs the latest version, |
@krzysztof-pawlik-gat sorry for the back and forth on this, I'm still concerned about a few things.
What is the nature of this warning? Is it an error/warning that the yarn community at large ignores or do you only want to ignore it for your use case? Are My other concern is that the change is adding yarn-specific functionality that will end up affecting users that aren't using yarn. Would it make sense to ignore missing packages only when a |
No problem at all, that's the purpose of reviews :)
I've seen such warnings a few times, while it's good to not have them, it looks like it's not extremely important, as ...
No, those old (and vulnerable) versions are not installed, only the latest one ( $ find node_modules/ -name lodash
node_modules/lodash From my testing it looks like the $ find node_modules/ -name lodash
node_modules/graphql-toolkit/node_modules/lodash
node_modules/lodash
node_modules/gat/node_modules/lodash
Good point, I've added a check for (fixed some EN issues) |
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 on this. I really appreciate you helping me understand the scope of the issue!
It's weird to be that yarn would have a message for a non-error case, 🤷, but this should be safe and its great that it's targeted.
Would you also mind adding a test to verify the new behavior when a yarn lockfile is present?
Let me know if you have any questions or concerns!
Added tests for this case. |
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.
a couple comments on the added test cases, let me know if you have any questions or if anything I'm asking for doesn't make sense 🙏
@jonabc Travis shows a failure for Haskel/cabal, this was not touched at all in this change, can you trigger the build again? (I don't want to push empty commits). |
Comments addressed, tests passing, I think this is ready for another round of 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.
Thanks for the updates!
I'm not sure that the new tests really need a new fixtures folder, but either way I'm only really concerned about unexpected test behavior if the yarn lockfile sticks around the local fixtures folder
Reworked tests to use a temporary directory (like |
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.
thanks again for the changes, everything looks great.
This could happen for
package.json
files for whichnpm
correctlyshows an error, but
yarn
works with them just fine.As it is not a correct
npm
case it's not trivial to add a test for this case (as it will be rejected bynpm
), this will become a moot issue when properyarn
source is introduced. This happened in a case where there was a dependency conflict, one of the libraries deep down required specific version oflodash
and at top level we require the latest one. The error was happening for the version deep down,npm
produced following list in JSON:Note the lack of
version
andpath
, but it hasmissing
set.