Skip to content

[Experiment] Populate child dependencies for Bundler graphs #12818

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

Draft
wants to merge 2 commits into
base: brrygrdn/dg-7449-ignore-gemfiles
Choose a base branch
from

Conversation

brrygrdn
Copy link
Contributor

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 the Dependabot::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 the metadata 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

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@brrygrdn brrygrdn requested a review from a team as a code owner August 11, 2025 17:13
@github-actions github-actions bot added the L: ruby:bundler RubyGems via bundler label Aug 11, 2025
@brrygrdn brrygrdn force-pushed the brrgrdn/dg-7449-immediate-child-dependencies branch from 7a53cf1 to 295934f Compare August 11, 2025 17:18
@brrygrdn brrygrdn marked this pull request as draft August 11, 2025 17:20
@brrygrdn brrygrdn force-pushed the brrygrdn/dg-7449-ignore-gemfiles branch from f3d7a8f to f41a8cc Compare August 13, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: ruby:bundler RubyGems via bundler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant