Renovate Configuration (as an SQLite database)
A tool to retrieve Renovate configuration from source forges and create an SQLite database with the configurations, which then enables follow-up queries.
This makes it useful for at-a-glance queries (see below for some examples) to understand what sort of configuration is in use across various repositories.
This is likely a somewhat overengineered solution, but I wanted to do it, so here it is.
Usage
Installation
The tool is a Go command-line tool, and supports being built from source:
go install gitlab.com/tanna.dev/renovate-config-sqlite@latest
Preparing the database
First, we need to create the database:
renovate-config-sqlite db init --db configs.db
Fetching data
To retrieve Renovate configuration from the oapi-codegen
org:
renovate-config-sqlite discover github --db configs.db --organisation oapi-codegen
Example queries
To give an idea about the different things that can be achieved with this data, check out the below example queries.
Which repos aren't using our shared configuration?
Let's say that you're using shareable config presets as an organisation, and you want to find which of your repos don't rely upon it.
We could write a query such as the below, assuming that you have a repo, renovate-config
in your organisation, your-org
:
select
distinct
organisation,
repo
from
renovate_configs,
json_each(
json_extract(renovate_configs.config, '$.extends')
)
where json_each.value NOT LIKE '%your-org/renovate-config%'
Which repos are using branch-based automerge?
Wondering which teams use automerge in branch
mode (where a PR won't be raised)?
select
distinct
organisation,
repo
from
renovate_configs
where
json_extract(renovate_configs.config, '$.automergeType') = 'branch'
Which repos use custom scheduling?
Want to work out which repos are using custom scheduling of their Renovate builds, i.e. to avoid clashing with other builds?
select
distinct organisation,
repo,
json_extract(renovate_configs.config, '$.schedule') as schedule
from
renovate_configs
where
schedule is not null
Known issues
- Unnecessary HTTP requests will be sent:
- Secondary rate limits may be received from GitHub depending on the size of organisation(s) being scanned
License
Licensed under the Apache-2.0.