Skip to content

Add an exported-API compatibility check to CI - #554

Closed
tony1233200 wants to merge 1 commit into
spf13:masterfrom
tony1233200:api-compat-check-552
Closed

tony1233200 wants to merge 1 commit into
spf13:masterfrom
tony1233200:api-compat-check-552

Conversation

@tony1233200

Copy link
Copy Markdown

Add an exported-API compatibility check to CI

Fixes #552.

Following the discussion in #441 and the scope confirmed by @tomasaschan in #552, this adds a CI-only check that compares the current code against the latest non-prerelease release using gorelease:

  • Runs on pull requests and on pushes to master.
  • Resolves the base version dynamically from git tags (latest v[0-9]* tag without a - suffix, currently v1.1.0), so it keeps working after the next release without editing the workflow.
  • Runs on stable Go and uses a pinned gorelease version (golang.org/x/exp/cmd/gorelease@v0.0.0-20261120130654-b6de8d37927a), leaving the library's Go 1.12 support unchanged.
  • Checkout uses fetch-depth: 0 so the release tags are available.

Verification (local, gorelease at the same pinned version):

  • gorelease -base v1.1.0 on current master (d77ebfa): passes, suggested version v1.1.1.
  • Negative control: renaming exported (*FlagSet).GetBool in a scratch copy makes gorelease exit 1 and report (*FlagSet).GetBool: removed.
  • go test -p 1 -count=1 ./..., go vet ./..., and gofmt -l are all clean.

Compare the current code against the latest non-prerelease
release with gorelease, on pull requests and pushes to master.
Fixes spf13#552.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tomasaschan

Copy link
Copy Markdown
Collaborator

See #553.

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.

Add an exported-API compatibility check to CI

4 participants