You can now parse repo-level Renovate configuration with renovate-graph

Featured image for sharing metadata for article

Almost 2 years ago (!) I built renovate-graph, a tool to extract the dependency trees for a given repository, which under the hood uses Renovate. I've been getting tonnes of value from it as part of how it fits into the wider dependency-management-data ecosystem, and providing more actionable data for understanding how you use internal and external dependencies in your projects.

I built renovate-graph as a lightweight shim over Renovate as a way to surface the dependencies in use in a project, but as it uses Renovate under-the-hood, it means that it needs to follow how Renovate works itself.

One of the many powerful features that Renovate has over other tools is its configurability is how you can add support for other ecosystems or files that aren't understood out-of-the-box with the Custom Regex Manager, which is hugely useful for data collection.

The other incredibly useful thing that teams can do with their configuration is disable Renovate from updating specific dependencies, i.e. if you only care about a subset of the dependencies that your repository has.

Therefore when renovate-graph runs, it makes sure to ignore the Renovate configuration in the given repository, so we don't risk disabling the collection of any interesting data.

This is because renovate-graph should collect the maximal data available for a given repository, regardless of whether it's a production dependency, dev/test dependency, or i.e. the version of Ruby recommended to use in the documentation.

When previous versions of renovate-graph run, the renovate.json in a given repo is explicitly ignored, which then has the risk of Custom Regex Manager rules being ignored, and missing out on interesting data it can surface.

The difficulty is how to selectively enable the configuration, which fortunately from the newly released renovate-graph v0.20.1, has now been solved, by forceing the packageRules and enabledManagers to a no-op.

Now you can run renovate-graph and collect any repo-specific data, as well as following any other extends or other presets that may be useful πŸš€

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#renovate #dependency-management-data.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.