Skip to content

chore: fix Roave BC check (composer >= 2.9.8) and restrict phpunit < 13.2#1127

Merged
nikophil merged 3 commits into
2.xfrom
fix/ci-bc-check-composer-token
Jun 25, 2026
Merged

chore: fix Roave BC check (composer >= 2.9.8) and restrict phpunit < 13.2#1127
nikophil merged 3 commits into
2.xfrom
fix/ci-bc-check-composer-token

Conversation

@nikophil

Copy link
Copy Markdown
Member

Why

The Roave BC Check job is currently red on every PR (e.g. #1085). It is not a real backward-compatibility break: the tool crashes before any comparison, while installing the previous version's dependencies, with:

In BaseIO.php line 143:
  Your github oauth token for github.com contains invalid characters: "ghs_..."
In invariant_violation.php line 16:
  Unable to retrieve current working directory.

Root cause

GitHub (re)deployed its new GitHub App installation token format ghs_<id>_<base64url-JWT>, whose base64url part contains hyphens (-).

Roave runs composer/composer in-process (LocateDependenciesViaComposerComposer\Installer) to install the old/new versions' deps. The locked composer/composer 2.9.3 validates GitHub tokens with {^[.A-Za-z0-9_]+$} — no hyphen allowed — so it throws and the check crashes (the getcwd error is a downstream PSL consequence).

composer/composer 2.9.8 relaxes this validation (CVE-2026-45793 / GHSA-f9f8-rm49-7jv2). The green 2.x runs simply predate GitHub's token rollout — a re-run would fail the same way.

What

  • bin/tools/bc-check/composer.json: require composer/composer: ^2.9.8 and regenerate the lock. The in-process composer used by Roave is now 2.10.1 (which dropped the throwing validation entirely), so the new token format is accepted. The CI step (composer bin bc-check require roave/...) honours the ^2.9.8 floor.
  • composer.json: restrict phpunit to ~13.1.0 (>=13.1.0 <13.2.0) to avoid the currently-broken phpunit 13.2.

Verification

The Roave BC Check job on this PR should now perform the actual comparison and pass, instead of crashing on the token validation.

nikophil added 3 commits June 25, 2026 21:51
The Roave BC check runs `composer/composer` in-process (via
LocateDependenciesViaComposer) to install the old/new versions' deps.
The locked composer/composer 2.9.3 validates GitHub OAuth tokens with
`{^[.A-Za-z0-9_]+$}`, which rejects GitHub's new App installation token
format `ghs_<id>_<base64url-JWT>` (it contains hyphens), crashing the
check with "github oauth token contains invalid characters".

composer/composer 2.9.8 fixes this (CVE-2026-45793 / GHSA-f9f8-rm49-7jv2)
by relaxing the validation. Pin >= 2.9.8 and regenerate the lock so the
in-process composer used by Roave accepts the new token format.
The bare `bin/tools/bc-check` path filter never matched files inside the directory, so changes to the BC check tooling did not re-run the check. Use a recursive glob so tooling bumps are validated.
@nikophil nikophil merged commit 6917146 into 2.x Jun 25, 2026
77 of 79 checks passed
@nikophil nikophil deleted the fix/ci-bc-check-composer-token branch June 25, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant