fix(mcp): restore 4.3 CI after #8522 - #8525
Merged
soyuka merged 2 commits intoSep 11, 2026
Merged
Conversation
src/Mcp references ApiPlatform\Metadata\Exception\BadRequestException, which only existed from 4.4 on. The 4.3 MCP jobs passed only because api-platform#8522 had pinned the metadata sibling to ^5.0@alpha; with the correct ^4.3 constraint restored they fail with "Class not found". Copied verbatim from 4.4 so the merge-up is a no-op. Fixes the 6 api-platform/mcp jobs (2 errors each) and PHPStan (4 errors).
api-platform#8522 rewrote array `type` nodes into anyOf branches in Mcp\JsonSchema\SchemaFactory (see api-platform#8504) but left McpTest::testToolsList asserting the old `type: [string, null]` shape, so it was merged red. This single assertion accounts for the failure in all 11 PHPUnit jobs on 4.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#8522 landed on 4.3 in a broken state, in two separate ways. This makes 4.3 green again.
Context: #8522 was based on
main, so squash-merging it onto 4.3 wrote main's tree into the maintenance branch (changelog,COMPOSER_ROOT_VERSION: 5.0.x-dev,^5.0@alphaacross 21 components, the Doctrine filter rewrites, thetools/relocation). That has since been reverted on 4.3. Removing the pollution exposed two real defects that the^5.0@alphapin had been masking.1. Missing
BadRequestException(fix(metadata))src/McpreferencesApiPlatform\Metadata\Exception\BadRequestException, which only existed from 4.4 onwards. With the correct^4.3metadata constraint restored:The file is copied verbatim from 4.4 (byte-identical there and on
main), so merging up is a no-op for it. It is self-contained — extends\RuntimeException, implementsExceptionInterface+HttpExceptionInterface, both already on 4.3 with a matching contract.Fixes the 6
api-platform/mcpjobs (2 errors each) andPHPStan (PHP 8.5)(4 errors, all inMcp/Tests/Server/HandlerTest.php).2. Stale
tools/listschema expectation (fix(mcp))#8522 rewrote array
typenodes intoanyOfbranches inMcp\JsonSchema\SchemaFactory(for #8504 — several MCP clients reject an arraytype), but never updated the functional test asserting the old shape:This one assertion is the sole failure in all 11 PHPUnit jobs on 4.3 (1 failure out of ~2008 tests in each).
Expected effect
PHPUnit (...)× 11McpTest::testToolsListPHPUnit api-platform/mcp× 6PHPStan (PHP 8.5)