Skip to content

ci: check the changeset level against the public API - #1737

Open
lukasIO wants to merge 2 commits into
mainfrom
claude/api-check
Open

lukasIO wants to merge 2 commits into
mainfrom
claude/api-check

Conversation

@lukasIO

@lukasIO lukasIO commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The level of a changeset is the claim of its author. No step compares it with the change of the public API. A PR can therefore release a breaking change as a patch.

Change

verwalter check has an API check, and this PR turns it on with cargo semver-checks.

  • verwalter.toml has a [check].api command, the script .github/scripts/api_check.sh. For each crate that a PR changes and a changeset covers, the tool compares the public API with the base of the PR. If the changeset level is below what the change needs, the PR fails, and the comment names the level to use. verwalter translates for a 0.x version: a breaking change needs minor.
  • The baseline is the base of the PR, not the last release tag. A changeset makes a claim for its own PR. Against the tag, a breaking change that is on main and not released would fail each later PR for the same crate.
  • The script checks the base out as a Git worktree with its submodules. The --baseline-rev option of the tool copies no submodules, and yuv-sys does not build without libyuv.
  • changeset-check.yml fetches the history and the submodules, sets up the Rust toolchain and installs cargo-semver-checks.
  • The check uses the default features only. livekit and livekit-api have TLS features that do not build together.
  • DOCS_RS=1 is set for the tool, so webrtc-sys/build.rs skips the native build.
  • livekit-ffi has no check. Its contract is the FFI protocol and the UniFFI bindings, not its Rust API.

Limits to know:

  • A PR with the internal label has no changeset, so it gets no API check.
  • An API behind a feature that is not a default feature is not checked.
  • If the tool cannot build the documentation of a crate, it prints no level, and the check passes. The output of the tool is in the summary of the run.

Verified

  • The script with a stand-in for cargo, in three cases. A report of a breaking change prints major. A clean report and a build failure print nothing. Each case ends with exit code 0.
  • The baseline worktree of the script: it is at the base commit and has yuv-sys/libyuv/include/libyuv.h.
  • A base branch that does not exist: the script fails, so the check fails.
  • verwalter 0.31.0 reads the new configuration, and actionlint passes on changeset-check.yml.

Not done yet

  • The tool did not run on this repository. On macOS it stops on the rustflags of .cargo/config.toml, which have a space for the macOS targets. The Linux runner has no such flags.
  • The first real test is a PR with a changeset. It shows the time that the check adds. It also shows which crates build with DOCS_RS=1.
  • A deliberate breaking change with a patch changeset is not tested.

🤖 Generated with Claude Code

`verwalter check` now runs cargo-semver-checks for each package that a
PR changes and a changeset covers. It compares the public API with the
last release tag and fails the PR if the changeset level is too low.

- Default features only: `livekit` and `livekit-api` have TLS features
  that do not build together.
- `DOCS_RS=1` skips the native build of webrtc-sys.
- `livekit-ffi` has no check.
- If the tool cannot build the documentation, the check passes. The
  output of the tool is in the summary of the run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lukasIO
lukasIO requested a review from ladvoc as a code owner November 24, 2026 22:28
@lukasIO lukasIO added the internal to tag changes that don't require changelog documentation label Nov 24, 2026
@lukasIO lukasIO self-assigned this Nov 24, 2026
@lukasIO
lukasIO requested a review from 1egoman November 24, 2026 22:29
Comment thread verwalter.toml
path = "livekit-ffi"
# No API check: the contract of this package is the FFI protocol and the
# UniFFI bindings, not its Rust API.
check.api = "true"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not sure about this one. should we still enforce the check for the FFI crate?

@MaxHeimbrock MaxHeimbrock Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am a bit confused again, maybe I just misunderstand the syntax. If this line says check.api = "true" I assume the semver check is on. But the lines above say "No API check".

I think what you mean is for the FFI we should check if the protobufs have breaking changes right? But the FFI crate now also is the home for the uniffi, so there I am not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

agree it's confusing, but it's about the return type, true means pass in this case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh wow, that is exactly opposite of how I read it. I feel like this will happen to others as well reading this syntax.

devin-ai-integration[bot]

This comment was marked as resolved.

- The baseline is the base of the PR, not the last release tag. Against
  the tag, a breaking change on `main` that is not released would fail
  each later PR for the same crate.
- The baseline is a Git worktree with its submodules. `--baseline-rev`
  copies no submodules, and yuv-sys does not build without libyuv, so
  the check passed without a result for yuv-sys and its dependents.
- The command is now a script, .github/scripts/api_check.sh.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@lukasIO lukasIO removed the internal to tag changes that don't require changelog documentation label Nov 24, 2026
Comment thread AGENTS.md
- A crate that depends on a bumped crate gets a `patch` bump automatically, so it needs no entry
- Choose the level by the public API. Every crate here is `0.x`, where a breaking change is `minor` and an addition or a fix is `patch`
- verwalter applies the level as written: `minor` on `0.2.0` gives `0.3.0`
- The changeset check runs `cargo semver-checks` for each changed crate with a changeset, and fails the PR if the level is below what the API change of that PR needs. It uses default features only, and `livekit-ffi` has no check (`[check].api` in `verwalter.toml`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"It uses default features only, and livekit-ffi has no check"

This sounds contradicting to the current change in verwalter.toml, because there the livekit-ffi has the check enabled right?

@MaxHeimbrock MaxHeimbrock left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally approve doing this, just not happy about the syntax.

This branch has not been deployed

No deployments
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.

2 participants