roave/backward-compatibility-check
A CLI tool that compares two versions of a PHP library and flags backward-compatibility breaks. It reads git tags and composer.json autoload paths, then fails CI builds when public API changes would break downstream consumers.
HEAD and fails the build on any BC break, which forces an explicit decision on every change: ship it as a patch/minor, or accept a major version and the migration guide, deprecation cycle, and comms work that come with it. This is exactly the roadmap tradeoff a PM should be making consciously rather than discovering after a customer's upgrade breaks.--format=markdown output produces a "what changed in the API" section for release notes, which removes a recurring manual chore.Adopt when:
git, uses composer.json, and all source paths are covered by an "autoload" section — the README is explicit about these preconditions, and failing them silently degrades results.fetch-depth: 0); the default shallow checkout breaks the "detect last minor tag" heuristic.x.y.z form. Without compliant tags there is no base version to compare against and the tool mostly does nothing useful.--format=github-actions output and the Nyholm Docker action make setup a few lines of YAML, which matters more than it sounds — cheap setup is what determines whether a quality gate survives its first quarter.Look elsewhere or skip when:
Adoption caveat for a Laravel shop specifically: it slots in cleanly as a dev dependency alongside Pint/PHPStan/Pest in CI for packages we ship, but it should not be added to every repo by default. Blanket adoption is the failure mode: it produces a green check nobody reads in app repos and dilutes the signal where it actually matters.
To executives (one paragraph): We ship PHP packages that other teams and, in some cases, external developers build on. Right now nothing technically stops a release from silently breaking those consumers — we rely on a reviewer noticing a changed method signature. That failure mode is expensive and late: it surfaces as a support ticket or a blocked upgrade, not a build failure. roave/backward-compatibility-check is a free, MIT-licensed CLI that compares the current branch to the last release tag and fails CI if we've broken our public API. Setup is roughly ten lines of YAML. It converts a class of post-release incidents into a pre-merge build failure, and it auto-generates the "what changed" section of our release notes. It costs a few hours to pilot on one package, and if it's noisy we uninstall it.
To engineering (the honest version):
roave/backward-compatibility-check as a dev dependency and one CI step, gated to published packages only. Use --format=github-actions so breaks annotate the PR diff instead of hiding in logs.fetch-depth: 0), SemVer x.y.z tags, and complete autoload coverage. Get those right first or the tool under-reports and we'll wrongly conclude it doesn't work..roave-backward-compatibility-check.xml baselines sparingly. Every ignored regex should reference a ticket and an intended removal. An indefinitely growing baseline is a signal we've stopped honoring SemVer, not a signal the tool is bad.How can I help you explore Laravel packages today?