Skip to content

ci: check the public API for incompatible changes on every pull request - #174

Merged
mogita merged 6 commits into
mainfrom
ci/public-api-check
Dec 2, 2026
Merged

mogita merged 6 commits into
mainfrom
ci/public-api-check

Conversation

@mogita

@mogita mogita commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A hand-written PR can remove or change public API without a ! in its title and ship as a minor. The Breaking changes check only looks at .spec-version, so such a PR passes it untouched.

Solution

  • A new "Public API stays compatible" step in the Breaking changes check job builds jars from the base tip and the merge commit and compares them with japicmp 0.27.0 (checksum pinned). An incompatible change fails the step unless the title has ! or the PR is labelled sdk-not-breaking.
  • -m keeps source-only breaks, such as a changed generic type, that --only-incompatible drops. Added methods are skipped, since callers use the service interfaces and never implement them, and so are model constructors, since Lombok's all-args constructor changes with every added field and callers use the builder.
  • The spec step reads the base .spec-version at the merge base, as stream-py does. Comparing against the base tip reported a downgrade on any branch cut before a regen merged.
  • CONTRIBUTING.md describes the check, and notes that the regen also writes footers from stream-sdk-java sdk lines.

How to verify

  1. This PR changes no Java code, so the new step prints "the public API stays compatible".
  2. Locally, against merge commits built the way actions/checkout builds them: 11.3.0 to main (31 commits) reported nothing; removing StreamSDKClient(Properties) failed with a ci: title and passed with feat!:; changing a model field from List<String> to List<Object> was reported.

Note

Low Risk
CI-only changes to PR gates and contributor docs; no runtime SDK behavior changes.

Overview
Closes a gap where hand-written PRs could ship API breaks as minors because the breaking-changes job only inspected .spec-version.

The Breaking changes check workflow now compares built JARs (base parent vs merge commit) with japicmp 0.27.0 (pinned checksum). Incompatible changes fail unless the title has conventional-commit ! or the PR is labelled sdk-not-breaking. The report keeps source-level breaks (e.g. generic changes) via -m, and filters noise from added service methods and Lombok model constructors.

The spec-version step reads .spec-version at the merge base instead of the base branch tip, avoiding false “downgrade” failures on branches cut before a regen merged. Job timeout moves from 5 to 10 minutes, and later steps use if: !cancelled().

CONTRIBUTING.md documents the japicmp check, stream-sdk-java sdk lines for regen footers, and that regen PRs can fail API comparison when generator changes alone break callers.

Reviewed by Cursor Bugbot for commit 4a2e81e. Bugbot is set up for automated code reviews on this repo. Configure here.

A hand-written change never moves .spec-version, so the Breaking changes
check passed it untouched. The job now also compares jars built from the
base tip and the merge commit with japicmp, and reads the base
.spec-version at the merge base.
@getstream-metis

getstream-metis Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

👋 Thanks, 🌵! I'm on it.

How to work with me

  • 💬 Disagree with a finding? Reply in its thread and tell me why. I'll withdraw it, or answer with evidence.
  • 🔁 Fixed it? Just push. The next round checks your fix and resolves the thread.
  • 👍 👎 Rate my findings. I learn what your team doesn't want flagged.
  • ✅ I approve once nothing blocking is left: must-fix always blocks, should-fix only in the first two rounds. CI isn't part of that; branch protection still holds the merge until it's green. On repos that require a human approval, a teammate still has to approve too.
Commands

Comment any of these on the PR:

  • /jeffery review · start a review
  • /jeffery next-round · start the next round now
  • /jeffery pause · /jeffery resume · stop or restart reviews on this PR
  • /jeffery status · where things stand
  • /jeffery help · all commands

@getstream-metis getstream-metis Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 1 · 🆕 2 new · nothing blocking

Worth a human look: Actual japicmp 0.27.0 stdout for a class-level modifier change, to confirm the awk filter reports it and extracts the class name (needs the jar and network)

➡️ Round 2 started on 9a090e1.

Comment thread .github/workflows/breaking_changes.yml Resolved
Comment thread .github/workflows/breaking_changes.yml Resolved
getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 2, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Approved · round 1

Nice work, 🌵! Nothing blocking is left on c7d1453dbb3c. Ship it 🚀

Left open, your call:

Worth a human look: Actual japicmp 0.27.0 stdout for a class-level modifier change, to confirm the awk filter reports it and extracts the class name (needs the jar and network)

…ke the other workflows

The title and changelog step runs even when the API step fails, so one run reports every error. The new checkout uses v5.0.1 like the rest of the repository. The API step's error now mentions the BREAKING CHANGE footer an override block needs, and CONTRIBUTING.md says a regen can fail the comparison too.
@getstream-metis
getstream-metis Bot dismissed their stale review December 2, 2026 08:41

Withdrawing approval until 9a090e1 is reviewed.

getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 2, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 · 🎉 Approved

Nice work, 🌵! Nothing blocking is left on 9a090e11e00a. Ship it 🚀

@getstream-metis
getstream-metis Bot dismissed their stale review December 2, 2026 09:26

Withdrawing approval until 3fe4804 is reviewed.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .github/workflows/breaking_changes.yml Resolved
getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 2, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 · 🎉 Approved

Nice work, 🌵! Nothing blocking is left on 3fe4804a2302. Ship it 🚀

@getstream-metis
getstream-metis Bot dismissed their stale review December 2, 2026 09:40

Withdrawing approval until cbcbabf is reviewed.

getstream-metis[bot]
getstream-metis Bot previously approved these changes Dec 2, 2026

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2 · 🎉 Approved

Nice work, 🌵! Nothing blocking is left on cbcbabf4d6d1. Ship it 🚀

A class made final, made package-private, or turned from an interface into a class shows only on japicmp's class header, as "(<- old)", so the filter skipped it. Those headers, and changed or removed generic type parameters, are now reported. The class name is also read before the trailing "  (...)", since a header such as "PUBLIC FINAL (<- NON_FINAL) io.getstream.models.OwnCapability" labelled its members "FINAL". From 10.5.0 to 11.0.0 this adds the three enum classes that became final; from 11.3.0 to HEAD it still reports nothing.
@getstream-metis
getstream-metis Bot dismissed their stale review December 2, 2026 09:59

Withdrawing approval until 4a2e81e is reviewed.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4a2e81e. Configure here.

Comment thread .github/workflows/breaking_changes.yml Resolved
Comment thread .github/workflows/breaking_changes.yml Resolved

@getstream-metis getstream-metis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Approved · round 3

Nice work, 🌵! Nothing blocking is left on 4a2e81e37def. Ship it 🚀

@mogita
mogita merged commit 2e0f6f3 into main Dec 2, 2026
12 checks passed
@mogita
mogita deleted the ci/public-api-check branch December 2, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant