Skip to content

fix: fix for assumed patch paths#257

Merged
lili2311 merged 2 commits intomasterfrom
fix/file-path-fix
Oct 31, 2018
Merged

fix: fix for assumed patch paths#257
lili2311 merged 2 commits intomasterfrom
fix/file-path-fix

Conversation

@lili2311
Copy link
Contributor

@lili2311 lili2311 commented Oct 30, 2018

Also amend how we re-lock the lockfile

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

  • Fixes a bug where for package-lock.json projects we are relying on the assumed patch paths for patching (since the lockfile is the exact shape of the node_modules)
    The bug was around us using cwd which is mostly used for tests and this was returning path paths like: /npm/node_modules/path-to-module/ instead of /node_modules/path-to-module/

  • Also fixing how we regenerate the lockfile if user selected to add snyk to dependencies. Update is relying on having the vuln from paths present, so skipping straight past all this and directly calling install && installDev since adding snyk is not part of the vuln testing flow

Where should the reviewer start?

https://github.com/snyk/snyk/compare/fix/file-path-fix?expand=1#diff-7d011e4c9a3d66fcafd27dede7916a27R17

How should this be manually tested?

Project goof can be used after adding a lockfile as an example

@lili2311 lili2311 self-assigned this Oct 30, 2018
@lili2311 lili2311 requested a review from miiila October 30, 2018 11:15
Copy link
Contributor

@miiila miiila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to clarify two things before approving:

Also amend how we re-lock the lockfile
@lili2311 lili2311 force-pushed the fix/file-path-fix branch 10 times, most recently from 24a3641 to 9c6ee03 Compare October 31, 2018 15:45
Copy link
Contributor

@miiila miiila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lili2311 lili2311 merged commit 3eb66e0 into master Oct 31, 2018
@lili2311 lili2311 deleted the fix/file-path-fix branch October 31, 2018 17:05
@snyksec
Copy link

snyksec commented Oct 31, 2018

🎉 This PR is included in version 1.105.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants