[Experiment] Populate child dependencies for Bundler graphs #12818
+101
−67
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.
What are you trying to accomplish?
Note
First, go review: #12816
The Gemfile.lock is the only place we can tell the dependencies of a dependency, but fortunately that's the only file we really need to submit, so let's make that change first
When we process a lockfile, we iterate over the file's
Bundler::LazySpecification
objects which knows the direct descendants of that package but we don't currently attach this to theDependabot::Dependency
object we return.This PR establishes the pattern of using
metadata[:depends_on]
key to return a list of dependent names that we can use when we are building graphs for the project.Anything you want to highlight for special attention from reviewers?
I elected not to add a new attribute to
Dependabot::Dependency
or its constructor and just use themetadata
hash as this is, well, metadata.We might decide to promote this later, but I'd rather revisit that after doing a few ecosystems so we have a better idea of what logic we want to push into base classes, etc with a few examples under our belt.
How will you know you've accomplished your goal?
We start seeing dependency relationships reflected in Dependency Insights when we use our experiment to submit a snapshot, and we're also able to see transitive paths in Dependabot Alerts when a vulnerable version is involved.
Checklist