-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add more helpful error messaging when a vulnerable dependency cannot be upgraded #5645
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7540bc0
Add an explanation when the vulnerablility auditor fix is unavailable…
Nishnha f5812c3
Add tests for vulnerability auditor explanation
Nishnha ffbe827
Undo lockfile error message changes
Nishnha 937ceba
conflicting_dependencies also returns vulnerablilty_audit
Nishnha c025d14
Improve removed dependency error messaging
Nishnha 81f09cb
Check fix_available key instead of its value
Nishnha 94c2c73
explain_fix_unavailable returns explanation string instead of fix_una…
Nishnha c600da7
Rubocop method length
Nishnha c0b6c74
Fix TypeError in UpdateChecker#conflicting_dependencies
Nishnha d44ab6c
vcr
Nishnha a409f8c
rubocop
Nishnha 6940876
add dependency_files per test
Nishnha d5cd873
remove extra security advisory test
Nishnha bfbff25
use valid security vulnerability ranges for dependency
Nishnha 87dff40
update vcr
Nishnha a23a3ef
lockfile use base versions
Nishnha bf62aaf
remove unused test with an unsatisfiable vulnerability
Nishnha a8d6b3a
ensure vulnerability auditor errors
Nishnha 1d32662
remove unused project
Nishnha 977d5ee
Merge branch 'main' into nishnha/npm-fix-type-error
Nishnha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
99 changes: 99 additions & 0 deletions
99
..._the_ConflictingDependencyResolver_and_VulnerabilityAuditor_and_explains_the_conflict.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
What would the explanation be if it's one of the parents that doesn't have an update to a non locking version? I think that'd be the primary use case of this error as we might not get here if the vulnerable dependency doesn't have a fix available.
Uh oh!
There was an error while loading. Please reload this page.
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.
I think that's captured by this test in the vulnerability auditor https://github.com/dependabot/dependabot-core/pull/5645/files#diff-f0c4f0847c642ca1ba8627d73ce6dfc76f107816ac9916ef12d3ae5c4edce665R122-R149
I used a vulnerable range without a fixed version to make sure the vulnerability auditor would error, but I can update the test to #5645 (comment)
Then the resulting error from the ConflictingDependencyResolver and VulnerabilityAuditor is
The error message from the vulnerability auditor is the same though. Would you expect it to list out the locking parent too?
Uh oh!
There was an error while loading. Please reload this page.
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.
I removed the test for "with an unsatisfiable vulnerability" in bf62aaf because I don't think we can reach that code without also having conflicting dependencies.
I updated the test with both "conflicting dependencies and an unsatisfiable vulnerability" to use an invalid version range for the vulnerability in a8d6b3a.
Our @dependabot-fixtures setup is not complex enough to test this scenario using valid vulnerability ranges, but it does seem like a case that can occur in a project, so I want to keep test coverage around it.
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.
I opened #5672 to create and test a scenario where a valid vulnerable version range is blocked by a locking parent dependency