Skip to content

ci(gen): add apidiff exported-API gate - #279

Merged
cbrgm merged 5 commits into
mainfrom
phase-0-apidiff-gate
Aug 12, 2026
Merged

ci(gen): add apidiff exported-API gate#279
cbrgm merged 5 commits into
mainfrom
phase-0-apidiff-gate

Conversation

@cbrgm

@cbrgm cbrgm commented Aug 12, 2026

Copy link
Copy Markdown
Owner

What

Add an apidiff gate that fails the build on any change to the exported API of ./githubevents.

  • scripts/apidiff.sh compares the PR's package API against the base branch via golang.org/x/exp/cmd/apidiff
  • make tools installs the pinned dev tools (gofumpt + apidiff), make apidiff runs the check
  • CI installs tools up front and runs apidiff after the tests

Stacked on #278. Review/merge that first.

Why

The package is used in production and re-exports go-github's event types, so an accidental exported-symbol change is a real risk. This gate makes any such change a hard CI failure -> the modernization PRs that follow are provably API-neutral.

One thing worth calling out: the gate will (correctly) flag a go-github major bump as incompatible, because the event type identities (*github.MetaEvent etc.) really do change for consumers. That's intentional and honest. It means go-github major PRs get a human ack rather than silent auto-merge. Since this gate isn't on main yet, #277 can still merge cleanly in the window after phase-1 lands.

Testing

  • renamed New -> NewX locally -> make apidiff fails with Incompatible changes: New: removed, exit non-zero
  • reverted -> >> API compatible, exit 0
  • apidiff pinned to a fixed version so the output-wording grep can't silently drift

Checklist

  • Tests added/updated (the gate itself is the test; verified fail + pass)
  • No breaking changes (tooling/CI only)
  • Readable commit history (1 commit)
  • AI code review considered and comments resolved

Base automatically changed from phase-1-gomod-version to main August 12, 2026 12:45
@cbrgm
cbrgm enabled auto-merge (squash) August 12, 2026 12:46
@cbrgm
cbrgm merged commit c5e91fd into main Aug 12, 2026
4 checks passed
@cbrgm
cbrgm deleted the phase-0-apidiff-gate branch August 12, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant