Read Anthropic’s case study about Graphite Reviewer

Introduction to GitHub’s dependency graph

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite

The GitHub dependency graph is a tool integrated into GitHub repositories that allows developers to track and analyze dependencies for their projects. Dependencies are external libraries or packages that a project relies on. The dependency graph helps ensure projects remain secure and up to date by identifying potential vulnerabilities or outdated components. It is particularly useful for teams aiming to streamline their dependency management and enhance security practices.

You can access the dependency graph by navigating to a repository’s Insights tab and selecting Dependency Graph from the sidebar. This graph is available for public repositories by default and for private repositories when enabled by repository owners.

screenshot of dependency graph

The dependency graph provides insights into:

  • Direct dependencies: These are explicitly included in your project’s configuration file (e.g., package.json, requirements.txt).
  • Transitive dependencies: These are dependencies of your dependencies.

GitHub automatically parses these dependencies from supported files and visualizes them, highlighting vulnerabilities where applicable.

GitHub's dependency graph integrates with GitHub Security Advisories to alert developers to vulnerabilities. If a dependency has a known issue, it is flagged in the graph. For example:

  1. Navigate to the Security tab.
  2. Check the Vulnerabilities section for flagged dependencies.

GitHub suggests fixes for vulnerabilities, such as updating to a secure version of a library. Using pull requests, developers can apply these fixes quickly.

While the dependency graph helps manage and secure dependencies, Graphite Insights complements this by offering actionable metrics across pull requests. For example:

  • Pull request dependency analysis: Graphite can identify how dependency updates correlate with PR approval or merge times.
  • Historical trends: See how dependency updates have impacted team velocity over weeks, months, or years.

Using Graphite Insights alongside the dependency graph enables a proactive approach to managing technical debt caused by outdated or insecure dependencies.

For private repositories, ensure the dependency graph is enabled:

  • Navigate to the repository settings
  • Enable "Dependency graph" and "Dependabot alerts" under the Security & Analysis section

Suppose your project relies on an older version of a library flagged for a vulnerability. GitHub’s dependency graph provides this information:

  • Open the Insights tab and select Dependency Graph.
  • Find the flagged dependency and review the suggested fix.
  • Generate a pull request to update the version.

After updating the dependency, use Graphite Insights to measure:

  • Time to merge: How long did the team take to review and merge the dependency update?
  • Review cycles: Were there multiple iterations before the update was approved?
  • Automate updates: Use GitHub Dependabot to automatically propose updates for dependencies.
  • Monitor insights: Combine GitHub dependency graph insights with Graphite Insights for a complete overview of dependency impacts.
  • Prioritize vulnerabilities: Tackle high-risk issues first to mitigate security threats.
  • Track performance: Use tools like Graphite Insights to ensure updates do not degrade team velocity.

By leveraging GitHub’s dependency graph and integrating Graphite Insights, teams can maintain secure and efficient dependency management workflows.

Built for the world's fastest engineering teams, now available for everyone