Skip to content

Suggestion: CI check for breaking API changes in api/v2/openapi.yaml #5094

@infracore

Description

@infracore

I noticed that api/v2/openapi.yaml is actively maintained — the recent silence annotations addition in #4965 touched 14 files across the spec and generated code. Your CI already validates that generated code stays in sync via git diff --exit-code, which is solid, but it doesn't catch whether a spec change introduces a backward-incompatible modification (e.g., removing a field from the silence response, changing a parameter type in /api/v2/alerts).

Given that the Alertmanager API is consumed by Grafana, third-party dashboards, and custom integrations across the Prometheus ecosystem, an accidental breaking change in the v2 spec could quietly break alerting pipelines in production.

Delimit is a GitHub Action that diffs OpenAPI specs on every PR and flags breaking changes before merge. It classifies 23 change types (10 breaking) and recommends the correct semver bump.

A minimal workflow for this repo would look like:

# .github/workflows/api-compat.yml
name: API Compatibility
on:
  pull_request:
    paths:
      - 'api/v2/openapi.yaml'

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: delimit-ai/delimit-action@v1
        with:
          spec_path: api/v2/openapi.yaml

This would complement your existing git diff --exit-code check — that catches uncommitted generated code, while this would catch backward-incompatible schema changes.

Happy to help set it up if the team is interested. There's also a quickstart repo you can fork to see it work in under 5 minutes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions