roschema: catch breaking .msg/.srv/.action changes in CI, before they hit the robot

Hey everyone,
Just wanted to advertise a ros-interface-diff-checker tool I built, in case it is useful for others.

As you’ve probably learnt the hard way, almost any edit to a ros interface (msg/action/srv) definition (add, remove, reorder, retype a field) silently breaks wire compatibility between mismatched nodes, and makes old ros bags unreadable (CDR serialization is positional). REP-2011 should eventually address evolving types at runtime, but there’s currently nothing to check for an accidental break before runtime, specifically at PR time.

So I wrote roschema. It diffs your interface definitions against a git ref, a directory, an MCAP bag, or a “lockfile”, and classifies every change (wire / source / introspection / behavior) with stable rule IDs you can configure or suppress:

uvx roschema check --against origin/main

It also lints naming conventions, has a canonical formatter, ships a GitHub Action, and needs no ROS installation, so it runs in any CI container.

Repo: GitHub - justagist/roschema: Catch breaking ROS 2 interface changes before deploying, not at runtime. Breaking-change detection, lint, and fmt for .msg/.srv/.action. · GitHub
The current rules used for the checks and lints are defined in the repo as well.

To test it without using your own ros environment or set up, you can take a look at this demo repo. It has a passing and a failing branch to compare, plus a ready-to-copy GitHub Action workflow.

Roschema is complementary to REP-2011 and type hashes, because those detect or mitigate at runtime, while roschema prevents at review time.

Feedback and issue reports very welcome, especially edge cases in the grammar or rules you’d want reclassified.

2 Likes