Skip to content

IBX-11939: Fix tagged migrations breaking when enable_service_migrations is false - #4

Merged
Steveb-p merged 3 commits into
4.6from
feature/doctrine-migrations-4.6
Aug 5, 2026
Merged

IBX-11939: Fix tagged migrations breaking when enable_service_migrations is false#4
Steveb-p merged 3 commits into
4.6from
feature/doctrine-migrations-4.6

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator
🎫 Issue IBX-11939

Related PRs:

Description:

RegisterMigrationsPass bound every IbexaMigrationTag-tagged migration's Connection/LoggerInterface constructor arguments to DoctrineMigrationsBundle's doctrine.migrations.connection/doctrine.migrations.logger services. Those two services are removed from the container entirely by DoctrineMigrationsExtension::load() when enable_service_migrations is false, so any tagged migration (e.g. ibexa/core's InstallSchemaMigration) made container compilation fail with:

The service "..." has a dependency on a non-existent service "doctrine.migrations.logger".

for any project not explicitly enabling that flag. Found while investigating a Behat CI failure on ibexa/core#785InstallSchemaMigration extends Doctrine\Migrations\AbstractMigration, whose constructor requires both a Connection and a LoggerInterface, so this wasn't an optional convenience binding.

Fix: both are now sourced from the application's own doctrine.migrations.dependency_factory (registered unconditionally by DoctrineMigrationsBundle regardless of enable_service_migrations) via two new Ibexa-owned services — ibexa.doctrine_migrations.connection and ibexa.doctrine_migrations.logger — rather than DoctrineMigrationsBundle's own aliases. doctrine.* service IDs belong to that bundle, not to Ibexa, to redefine.

…ons is false

RegisterMigrationsPass bound every IbexaMigrationTag-tagged migration's
Connection/LoggerInterface constructor arguments to DoctrineMigrationsBundle's
doctrine.migrations.connection/doctrine.migrations.logger services. Those two
services are removed from the container entirely when enable_service_migrations
is false, which made container compilation fail with a
"non-existent service" error for any project not enabling that flag.

Source both values from the always-available doctrine.migrations.dependency_factory
via two new Ibexa-owned services (ibexa.doctrine_migrations.connection/.logger)
instead, since doctrine.* service IDs belong to DoctrineMigrationsBundle.
@Steveb-p

Copy link
Copy Markdown
Collaborator Author

5.0 tier: #5

@Steveb-p
Steveb-p merged commit c040c5b into 4.6 Aug 5, 2026
13 of 14 checks passed
@Steveb-p
Steveb-p deleted the feature/doctrine-migrations-4.6 branch August 5, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants