Skip to content

ci: raise inter-component floors so the PHP 8.5 lowest jobs pass - #8445

Open
ousamabenyounes wants to merge 1 commit into
api-platform:mainfrom
ousamabenyounes:fix-8444-doctrine-common-lowest
Open

ci: raise inter-component floors so the PHP 8.5 lowest jobs pass#8445
ousamabenyounes wants to merge 1 commit into
api-platform:mainfrom
ousamabenyounes:fix-8444-doctrine-common-lowest

Conversation

@ousamabenyounes

@ousamabenyounes ousamabenyounes commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #8444
License MIT
Doc PR n/a

Summary

doctrine-orm, doctrine-odm and json-api declare ^5.0@alpha for sibling
components whose APIs they already use. Under --prefer-lowest Composer honours
that constraint literally and installs 5.0.0-alpha.1, which does not provide
those APIs — so the three PHP 8.5 lowest component jobs fail. The declared
constraint is simply narrower than what the code needs; this widens it to the
released version that actually provides the behaviour.

This is not a pin to make CI green: 5.0.0-alpha.2 is a real published release,
and alpha.1 genuinely cannot run this code.

doctrine-orm / doctrine-odm

src/Doctrine/Orm/Filter and src/Doctrine/Odm/Filter (2 files each) use
ApiPlatform\Doctrine\Common\Filter\NameConverterAwareTrait, added to
doctrine-common in #8351. The file is absent from the v5.0.0-alpha.1 tag and
present from v5.0.0-alpha.2:

$ gh api repos/api-platform/doctrine-common/contents/Filter/NameConverterAwareTrait.php?ref=v5.0.0-alpha.1
404 Not Found
$ gh api repos/api-platform/doctrine-common/contents/Filter/NameConverterAwareTrait.php?ref=v5.0.0-alpha.2
NameConverterAwareTrait.php

so the lowest job dies before it can assert anything:

Error: Trait "ApiPlatform\Doctrine\Common\Filter\NameConverterAwareTrait" not found

json-api

ItemNormalizer resolves the operation for a circular reference through
behaviour that serializer only has from v5.0.0-alpha.2.

Test verification (before → after)

Reproduced the PHP 8.5 lowest component job exactly as CI runs it — cd into
the component, composer update --prefer-lowest --prefer-source, then the
component's own PHPUnit — on main, with only the constraint changed:

doctrine-orm

Before (api-platform/doctrine-common: ^5.0@alpha → resolves 5.0.0-alpha.1):

api-platform/doctrine-common       5.0.0-alpha.1 Common files used by api-p...
Error: Trait "ApiPlatform\Doctrine\Common\Filter\NameConverterAwareTrait" not found

Filter/ExistsFilter.php:130
Tests/Filter/ExistsFilterTest.php:232
Tests/Filter/ExistsFilterTestTrait.php:23

ERRORS!
Tests: 293, Assertions: 871, Errors: 43, Deprecations: 35.

After (^5.0.0-alpha.2 → resolves 5.0.0-alpha.2):

api-platform/doctrine-common       5.0.0-alpha.2 Common files used by api-p...

Tests: 293, Assertions: 916, Deprecations: 35.
OK, but there were issues!

json-api

Before (api-platform/serializer: ^5.0@alpha → resolves 5.0.0-alpha.1):

api-platform/serializer            5.0.0-alpha.1 API Platform core Serializer

1) ApiPlatform\JsonApi\Tests\Serializer\ItemNormalizerTest::testNormalizeCircularReference
ApiPlatform\Metadata\Exception\OperationNotFoundException: Operation "" not found for resource "CircularReference".

vendor/api-platform/metadata/Resource/ResourceMetadataCollection.php:111
vendor/api-platform/metadata/Resource/ResourceMetadataCollection.php:97
Serializer/ItemNormalizer.php:448
Serializer/ItemNormalizer.php:150
Tests/Serializer/ItemNormalizerTest.php:229

ERRORS!
Tests: 74, Assertions: 200, Errors: 1, Deprecations: 17.

After (^5.0.0-alpha.2 → resolves 5.0.0-alpha.2):

api-platform/serializer            5.0.0-alpha.2 API Platform core Serializer

Tests: 74, Assertions: 201, Deprecations: 3.
OK, but there were issues!

That local failure is the same string the CI job reports, so the reproduction is
faithful and not an artefact of the local setup.

Note on CI visibility

These three jobs currently cannot be seen failing on main, because every job
aborts earlier at composer global require "soyuka/pmu:"main lost the
PMU_VERSION env entry in a merge up. #8474 restores it; with that applied, the
CI surfaces exactly the two failures this PR fixes.

@ousamabenyounes
ousamabenyounes force-pushed the fix-8444-doctrine-common-lowest branch 2 times, most recently from b808dd8 to 25e0db5 Compare August 10, 2026 16:58
@ousamabenyounes ousamabenyounes changed the title fix(doctrine): green the PHP 8.5 lowest CI for the orm/odm bridges fix(ci): raise inter-component floors so the PHP 8.5 lowest jobs pass Aug 10, 2026
@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Extended to json-api: same class of defect. Its ItemNormalizer needs operation-resolution behavior that serializer shipped in v5.0.0-alpha.2, so I raised that one floor too. RED to GREEN verified for all three (doctrine-orm 293/0, doctrine-odm 0, json-api 74/0) under --prefer-lowest on PHP 8.5.

@ousamabenyounes
ousamabenyounes force-pushed the fix-8444-doctrine-common-lowest branch from 25e0db5 to 9ae0e0e Compare August 16, 2026 16:51
The doctrine-orm/odm and json-api bridges declared "^5.0@alpha" for siblings
whose APIs they now use, but those APIs first shipped in 5.0.0-alpha.2, so
--prefer-lowest installs alpha.1 and the components fail at runtime:

- orm/odm filters use NameConverterAwareTrait, which doctrine-common only
  ships from v5.0.0-alpha.2 (added in api-platform#8351):
  Trait "ApiPlatform\\Doctrine\\Common\\Filter\\NameConverterAwareTrait" not found
- json-api ItemNormalizer resolves the operation for a circular reference
  through behaviour serializer only has from v5.0.0-alpha.2:
  OperationNotFoundException: Operation "" not found for resource "CircularReference"

Raise each floor to the real released version that provides the behaviour, so
the declared constraint matches what the code actually needs.
@ousamabenyounes
ousamabenyounes force-pushed the fix-8444-doctrine-common-lowest branch from 9ae0e0e to e7d0456 Compare August 22, 2026 23:42
@ousamabenyounes ousamabenyounes changed the title fix(ci): raise inter-component floors so the PHP 8.5 lowest jobs pass ci: raise inter-component floors so the PHP 8.5 lowest jobs pass Aug 22, 2026
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.

1 participant