core(vulnerable-libs): add fix for recovering from bad versions#3932
Merged
core(vulnerable-libs): add fix for recovering from bad versions#3932
Conversation
paulirish
reviewed
Nov 28, 2017
| }) | ||
|
|
||
| it('should fix bad version numbers', () => { | ||
| assert.equal(NoVulnerableLibrariesAudit.normalizeVersion('11.51'), '11.51.0'); |
Collaborator
Author
There was a problem hiding this comment.
seemed reasonable to me as there were a lot in sentry, but I'm not sure any libraries that we for which we get just major.minor actually have a corresponding npm package
I'm fine to revert if you think its bad
| return vulns; | ||
| } | ||
|
|
||
| lib.pkgLink = 'https://snyk.io/vuln/npm:' + lib.npmPkgName |
Member
There was a problem hiding this comment.
do me a favor and update this line to
lib.pkgLink = `https://snyk.io/vuln/npm:${lib.npmPkgName}#lh@${lib.version}`;| return vulns; | ||
| } | ||
|
|
||
| try { |
Member
There was a problem hiding this comment.
idea: instead of try/catch we could make another call to semver.valid() . i don't care much either way. you?
Collaborator
Author
There was a problem hiding this comment.
well I wanted to reuse the error object it generates to beacon to sentry, but I suppose not the end of the world to create our own with captureMessage instead?
I'm don't feel particularly strongly either way
paulirish
approved these changes
Nov 29, 2017
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.
fixes #3624