Repository navigation
chore(AIC-3500): fail CI on an undeclared breaking change to the public API - #154
Merged
Merged
Conversation
…ry point Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to the public API Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apucacao
approved these changes
Oct 23, 2026
# Conflicts: # AGENTS.md
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.
Step 5 of AIC-3500 for JS, part 2: CI fails on a breaking change to the public API unless the PR declares it (checks 2 and 3, TESTING.md §5.2). The Python version is python-ai-sdk#196. Stacked on #153.
What changes
scripts/api-breaking.mjs(plain Node, no dependencies, likeapi-surface.mjs) compares each non-experimental report declaration by declaration.@deprecateddon't count.api-compatiblelabel.prmode passes when the title has!(same regex as Python) or the PR hasapi-compatible.releasemode runs on the release-please PR. For each package whose version changes, it compares against the package's last release tag (<component>-<version>, fromrelease-please-config.json). A breaking change needs a major bump, or a minor one before 1.0..github/workflows/api-compatibility.yml: same triggers as Python's (edited,labeledandunlabeledre-run it) and the same release-PR detection (release-please--branches--main). The title goes throughenv, not shell interpolation.node:testtests (yarn test:api-breaking, run in CI) in a throwaway git repo.Verified
yarn test:api-breaking(24 passed).prrun against part 1 and againstmainsays "No breaking changes to the public API."input?:toinput:in the openai-messages report fails and shows the old and new lines; with afeat!:title it passes.releasemode, with the manifest edited temporarily: client 0.4.0 → 0.4.1 fails (and passes withapi-compatible), and 0.4.0 → 0.5.0 passes.ai-serverdeclarations have changed since@launchdarkly/ai-server-0.4.0. The open release PR chore: release main #131 bumps the client to 0.5.0, which passes. I didn't run the script against that branch.Known limit: the provider packages have no report at their last release tag, so check 3 skips them, with a message, until their next release.
🤖 Generated with Claude Code
Note
Overview
Adds API compatibility enforcement so CI blocks undeclared breaking changes to committed API Extractor reports (
packages/*/etc/*.api.md).A new
scripts/api-breaking.mjscompares stable (non-experimental) reports declaration-by-declaration: removals, signature/type changes, and deleted reports count as breaking; additions do not; comment-only edits are ignored. PR mode fails unless the title uses conventional!(feat!:, etc.) or the PR has theapi-compatiblelabel. Release mode (release-please branch) compares each bumped package to its last release tag and requires a major bump (or pre-1.0 minor) when breaking diffs exist, with the same label escape hatch.A dedicated
.github/workflows/api-compatibility.ymlruns those checks on PR events (including title/label edits). Mainci.ymlrunsyarn test:api-breaking(24 fixture git tests).AGENTS.mddocuments the policy for contributors.Reviewed by Cursor Bugbot for commit 08fbcc1. Bugbot is set up for automated code reviews on this repo. Configure here.