Skip to content

IBX-13461: Dropped third-party deprecations raised while building the test container - #100

Draft
Steveb-p wants to merge 1 commit into
6.0from
IBX-13461-container-build-deprecation-filter
Draft

Steveb-p wants to merge 1 commit into
6.0from
IBX-13461-container-build-deprecation-filter

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator
🎫 Issue IBX-13461

Related PRs:

Description:

Symfony raises some deprecations while compiling the container, e.g. 8.2's deprecated Symfony\Component\EventDispatcher\EventDispatcherInterface alias referenced by league/oauth2-server-bundle's services. That happens in the first test that boots the kernel, and PHPUnit classifies every one of them as "third-party code calling into third-party code" (callee deprecation-contracts/function.php, caller a Symfony compiler pass), whoever's config caused it. So with failOnDeprecation a single vendor bundle fails CI in every package that boots it. ignoreIndirectDeprecations="true" isn't a way out either: for the same reason it also hides the ones the package's own config and compiler passes cause.

IbexaTestKernel::initializeContainer() now runs inside ContainerBuildDeprecationFilter, which decides who owns each E_USER_DEPRECATED raised while the container is built:

  1. the code that triggered it, when it's ours;
  2. otherwise the first caller outside Symfony, e.g. a bundle's extension or compiler pass;
  3. when the whole stack is Symfony, the service the running AbstractRecursivePass processes (hidden . ids are kept, as they can belong to anyone).

Deprecations owned by third-party code are dropped, the rest reach PHPUnit unchanged (same file and line, so baselines keep matching). Anything it can't attribute is kept, and runtime deprecations aren't touched. Every integration kernel extends IbexaTestKernel, so packages don't need any change.

What counts as ours is up to the IBEXA_TEST_DEPRECATION_SCOPE env variable:

  • ibexa (default): the package itself, everything in vendor/ibexa, and services with an ibexa id or class;
  • package: the package itself and services whose class is defined outside vendor/, so deprecations owned by other Ibexa packages are dropped too. When a service's class can't be loaded, it falls back to the ibexa naming rule.
<php>
    <env name="IBEXA_TEST_DEPRECATION_SCOPE" value="package"/>
</php>

An unknown value throws. A package should only switch to package once the packages it depends on fail on deprecations in their own integration tests, otherwise nothing catches theirs. Many integration configs don't set failOnDeprecation yet (e.g. ibexa/core, payment, corporate-account, shipping).

I checked it against copies of dam-user and checkout 6.0. league's 3 deprecations are gone from dam-user, and probes for our own config, our own compile-time code and our code calling a deprecated vendor API still fail in both scopes. checkout still reports the 8 caused by payment, corporate-account, fieldtype-address and shipping services with the default scope, and passes with package.

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