renovate-config-sqlite

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

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

License

Licensed under the Apache-2.0.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL