-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Security Update Support for Pub #6230
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
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
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.
Good question! Yes, it does but I'm not sure if:
I think it's worth confirming and then documenting if we don't support them yet.
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.
Here's a manual run of a public repo with a transitive dep:
As expected, it throws
update_not_possible.Here's a similar run against that repo, but for a direct dep:
I was a little surprised that ☝️ says "no update needed as already up-to-date" rather than "no non-vulnerable version available"... but turns out that's because of the
dry-runscript logging not first checking for vulnerable:dependabot-core/bin/dry-run.rb
Lines 682 to 694 in c2b0cf8
I'll open a separate PR to tweak that shortly.
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 believe we can do all of those to varying degrees.
The native helper
reportcommand returns multiple packages that are unlocked simultaneously if needed, see:dependabot-core/pub/README.md
Line 67 in 575bb90
The native helper
applycommand takes a list of dependencies to update:dependabot-core/pub/README.md
Line 200 in 575bb90
We use that for the full unlock here:
dependabot-core/pub/lib/dependabot/pub/update_checker.rb
Line 92 in 4acd031
See the tests here:
dependabot-core/pub/spec/dependabot/pub/update_checker_spec.rb
Line 250 in 575bb90
However, as eg.
updated_requirementsonly allows us to return a single requirement update the native helpersapplycommand does its own resolution to re-find any transitive dependencies that has to be unlocked along with the one we are interested in currently: https://github.com/dart-lang/pub/blob/4c9ebd0e53796f0d45f9fcb79a14a3fa149beac2/lib/src/command/dependency_services.dart#L461If updated_requirements allowed us to return the full set of updates, not just a single one we could (potentially) save doing this resolution.
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.
PR here: #6258