Analysers Guide

Analysers inspect different facets of your project to detect API changes. Bumpwright ships optional analysers for the CLI, gRPC services, web routes, database migrations, OpenAPI documents and GraphQL schemas. The table below lists each analyser, the key used to configure it, and the CLI flag to enable it for a single run.

Available analysers

Analyser

Configuration key

CLI flag

CLI

cli

--enable-analyser cli

gRPC

grpc

--enable-analyser grpc

Web routes

web_routes

--enable-analyser web_routes

Migrations

migrations

--enable-analyser migrations

OpenAPI

openapi

--enable-analyser openapi

GraphQL

graphql

--enable-analyser graphql

Enable analysers in bumpwright.toml:

[analysers]
cli = true        # enable CLI analysis
grpc = true       # enable gRPC analysis
web_routes = true # enable web route analysis
migrations = true # enable migrations analysis
openapi = true    # enable OpenAPI analysis
graphql = true    # enable GraphQL analysis

[migrations]
paths = ["migrations"]  # directories with Alembic scripts

[openapi]
paths = ["openapi.yaml"]

You can also toggle analysers per invocation with the command-line flags --enable-analyser and --disable-analyser.

Python API analyser

The default analyser inspects Python modules to track changes to the public API. If a module defines __all__, those names form the public interface. Otherwise, all module- or class-level members whose names do not start with _ are considered public. Names with leading underscores, including dunder methods, are ignored.

__all__ = ["foo", "Bar"]

def foo(): ...
def _hidden(): ...

class Bar:
    def baz(self): ...
    def _private(self): ...

The analyser includes foo and Bar.baz in the public API, while _hidden and Bar._private are excluded.