Skip to content

Add Roave Backward Compatibility Check to CI - #37

Merged
Art4 merged 12 commits into
masterfrom
refactor/23-roave-bc-check
Nov 21, 2026
Merged

Art4 merged 12 commits into
masterfrom
refactor/23-roave-bc-check

Conversation

@Art4

@Art4 Art4 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Pull requests that break the public API the BC promise covers now fail in CI before they are merged, instead of being found after a release.

Closes #23

Adds a workflow with one job that runs the docker://nyholm/roave-bc-check-ga action with the full history and tags fetched (fetch-depth: 0). It prints every break twice: as a list in the log (--format=console) and as one annotation per break (--format=github-actions). The autoload section of composer.json already covers src, so nothing else changed.

Decision: the job compares against the merge commit of #32 (--from=d5057e5), not against the tag 1.7.1. The classes outside the BC promise were marked @internal after 1.7.1, and the tool reports that as 32 breaks, all of them allowed by the promise. The action's tool version has no baseline or ignore file, so the reference is moved instead. After the next release, remove --from so the newest tag is used again (the comment in the workflow says so).

Checks: PHPUnit and PHPStan pass locally in the dev container on PHP 7.4. In CI the new job passes ("No backwards-incompatible changes detected"). The PHP 7.4 or 8.0 test job sometimes fails with a Coveralls error ("Can't add a job to a build that is already closed"): both jobs upload to the same Coveralls build and the later one is rejected. It is in the existing workflow and not part of this change.

@coveralls

coveralls commented Nov 21, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 97.782%. remained the same — refactor/23-roave-bc-check into master

@Art4

Art4 commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Review: the change is fine, but the checks are not green, and the cause is not in this pull request.

The new job passes ("No backwards-incompatible changes detected"), and the diff is one workflow file that only adds the check. The job `Tests (PHP 7.4)` fails in the step `Upload coverage results to Coveralls`, not in the tests: Client error occurred. status: 422 Unprocessable Entity. Can't add a job to a build that is already closed. The matrix jobs upload to the same Coveralls build, and the job that finishes first closes it. Which job fails is a matter of timing, and re-running the failed job cannot succeed because the build stays closed. With the seven jobs of #33 it will happen more often.

Question for the maintainer: should this be fixed in a separate pull request that #33 and this one are rebased onto? The simplest fix is to upload the coverage from one matrix entry only, for example from PHP 7.4.

Until that is decided this pull request stays a draft.

Two notes for later: the `--from=d5057e5` in `.github/workflows/bc-check.yml` has to be removed after the next release, so that the newest tag is used again, and the history of this branch has debug commits, so squash on merge is advisable.

@Art4
Art4 marked this pull request as ready for review November 21, 2026 17:42
@Art4

Art4 commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Review: mergeable. master was merged into the branch. The new job passes together with the tests, and the diff is one workflow file. Notes: the --from=d5057e5 in .github/workflows/bc-check.yml has to be removed after the next release so that the newest tag is used again; the history of this branch has debug commits, so squash on merge is advisable; the details of every break appear in the log (--format=console) and as annotations (--format=github-actions), which CI cannot show as long as there is no break. Leaving the merge to the maintainer.

@Art4
Art4 merged commit 906b259 into master Nov 21, 2026
3 checks passed
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.

Add Roave Backward Compatibility Check to CI

2 participants