Back to directory
hashmap-kz avatar
hashmap-kz / relimpact

relimpact

Fast API compatibility reports for Go projects

13

Stars

0

Forks

0

Watchers

MIT

License

relimpact

Fast API compatibility reports for Go projects.

License Go Report Card Go Reference Workflow Status GitHub Issues Go Version Latest Release

relimpact compares two Git refs, snapshots the exported Go API, and reports what changed: breaking changes first, compatible additions below.

It is not a raw diff tool or a changelog generator. It answers one release question:

Did this change break public Go API?


Preview

Breaking Changes

Breaking Changes

New API

New API

PR comment

Markdown Format

Install

Using Go:

go install github.com/hashmap-kz/relimpact@latest

Using Homebrew:

brew tap hashmap-kz/homebrew-tap
brew install relimpact

Or download a binary from the Releases page.

Usage

Markdown output is the default:

relimpact --old=v1.0.0 --new=HEAD > api-report.md

HTML output:

relimpact --old=v1.0.0 --new=HEAD --format=html > api-report.html

Run against another repository:

relimpact --dir=/path/to/repo --old=v1.0.0 --new=HEAD

Use maximum concurrency:

relimpact --old=v1.0.0 --new=HEAD --greedy

GitHub Actions

Generate a Markdown report and post it as a pull request comment:

name: API compatibility

on:
  pull_request:
    branches: [ master ]

permissions:
  contents: read
  pull-requests: write

jobs:
  relimpact:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-go@v5
        with:
          go-version: "1.25"

      - name: Install relimpact
        run: |
          go install github.com/hashmap-kz/relimpact@latest

      - name: Generate Markdown API report
        run: |
          relimpact \
            --old="${{ github.event.pull_request.base.sha }}" \
            --new="${{ github.event.pull_request.head.sha }}" \
            --format=markdown \
            > api-report.md

      - name: Comment API report on PR
        uses: marocchino/sticky-pull-request-comment@v2
        with:
          header: relimpact-api-report
          recreate: true
          path: api-report.md

To also keep the HTML report as a CI artifact:

      - name: Upload HTML API report
        run: |
          relimpact \
            --old="${{ github.event.pull_request.base.sha }}" \
            --new="${{ github.event.pull_request.head.sha }}" \
            --format=html \
            > api-report.html

      - name: Upload HTML artifact
        uses: actions/upload-artifact@v4
        with:
          name: api-report
          path: api-report.html

License

MIT License. See LICENSE for details.

Releases

Changelog New Features

f76a669 feat: ctx usage in hot paths, simplify project structure

Bug fixes

7c3005a fix: minor changes in CLI usage

Dependency updates

02a3eed build(deps): bump actions/chec...

Changelog Bug fixes

0670d2d fix: embedded or named structs (strip owner prefix) 1da10c7 fix: update readme (add MD example) 9b457be fix: update readme (add MD example) 4b087c8 fix: update readme (add...

Changelog New Features

7fc8d22 feat: apidiff only, --output option (html, md) 7be2088 feat: breaking changes and new features nav d1cb1a6 feat: update html reporting a6ded79 feat: update markdown ren...

Changelog New Features

9d8e1c7 feat: init integration tests

Bug fixes

401be26 fix: add toSlash for docs files 5fb92d7 fix: bin finder fn (integ-tests) c23d13b fix: slashes in testdata 24ae6d2 fix:...

Changelog New Features

c2307be feat: change summary table layout d30df45 feat: logging instead of fmt 3bff3cd feat: update versions

Bug fixes

bca9ad5 Revert "fix: cleanup" 573891a fix: cleanup 3673...