ci(gen): add apidiff exported-API gate - #279
Merged
Merged
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add an apidiff gate that fails the build on any change to the exported API of
./githubevents.scripts/apidiff.shcompares the PR's package API against the base branch viagolang.org/x/exp/cmd/apidiffmake toolsinstalls the pinned dev tools (gofumpt + apidiff),make apidiffruns the checkStacked 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.MetaEventetc.) 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 onmainyet, #277 can still merge cleanly in the window after phase-1 lands.Testing
New->NewXlocally ->make apidifffails withIncompatible changes: New: removed, exit non-zero>> API compatible, exit 0Checklist