raise when a path dependency is absolute#5869
Merged
jakecoffman merged 2 commits intomainfrom Oct 11, 2022
Merged
Conversation
jurre
approved these changes
Oct 11, 2022
Member
jurre
left a comment
There was a problem hiding this comment.
Should we only do this when path.start_with?("/") or for any path that we cannot resolve?
Member
Author
|
@jurre True, maybe I'll end up removing this with a more general solution. We do already have this code which tries to fill out any dependencies it couldn't fetch. It seems like I could just add a raise there when there's no lockfile present. I'll find an example that hits that case and take another pass at it and see if I can remove the special case in this PR. |
Co-authored-by: Landon Grindheim <landon.grindheim@gmail.com>
Member
Author
Merged
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.

According to the NPM docs, a path dependency can be relative or absolute.
Absolute path dependencies can never be resolved by Dependabot and are resulting in EACCES errors when it tries to create files in various places around the update container that it doesn't have access to. For instance there are a considerable amount of errors trying to create
/Userswhich is probably a macOS path in the manifest.So I think our best option here is to throw an appropriate error to bring it to the user's attention.