-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Proof of Concept: Dependency Graph-Based Update Process for npm and Yarn #11262
base: main
Are you sure you want to change the base?
Conversation
add generated dependencies graphs into dependency snapshot
# frozen_string_literal: true | ||
|
||
module Dependabot | ||
class DependencyGraph |
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.
Can we reuse the graph from the dependency-graph team if they have such a concept?
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.
Yes, we can use it. Currently waiting them reply. I think it is going to be something similar to what I am doing. Just need to modify places related to the structure such as add dependencies and so on but lock files parsings are going to be in this way just will need to add main/transtive dependencies somehow to the structure.
👋 Hello @kbukum1 and @abdulapopoola (cc'ing @brrygrdn who is working on the new DG -> Dependabot APIs) In DG's legacy services we do not maintain a dependency tree we store flat lists as you mention. The new service is storing edge pair connections to model the dependency tree more accurately alongside those lists, but there are some caveats to the representation we capture at the moment:
Also worth noting but may not be a blocker for you - the edge-pair representation of the connections between the packages in a project comes with some access pattern concerns we're still sussing out use case by use case. For instance we should be able to support the following access patterns fairly well:
Here, a "project" means a single NPM Hope that's helpful for a start. I assume Barry will have thoughts as well, but happy to answer more questions for you if I can 👍 |
Thank you @elireisman for all the information. That's was really helpful. I will go over the ADR that you shared and will see if this approach going to be ok for us. |
What are you trying to accomplish?
This PR introduces a Proof of Concept (PoC) for using a Directed Acyclic Graph (DAG) structure in
dependabot-core
to manage dependencies more effectively. The focus is on the npm_and_yarn ecosystem, which includes three package managers—npm, pnpm, and yarn. These package managers have distinct lockfile formats and functionalities, making it challenging to manage them effectively using the current flat list dependency structure.Why:
Anything you want to highlight for special attention from reviewers?
package.json
,package-lock.json
)pnpm-lock.yaml
)yarn.lock
)How will you know you've accomplished your goal?
Checklist