Skip to content

IBX-12530: Allowed Bootstrapper to run against any KernelInterface, not just IbexaTestKernel - #44

Merged
Steveb-p merged 1 commit into
4.6from
bootstrapper-generic-kernel
Sep 10, 2026
Merged

IBX-12530: Allowed Bootstrapper to run against any KernelInterface, not just IbexaTestKernel#44
Steveb-p merged 1 commit into
4.6from
bootstrapper-generic-kernel

Conversation

@Steveb-p

@Steveb-p Steveb-p commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator
🎫 Issue IBX-12530

Related PRs:

Description:

Bootstrapper couldn't be used by a package testing its own bundle in isolation, for two independent reasons.

The type was the smaller one. KernelProvider asserted an IbexaTestKernel subclass and DatabasePreparer/Bootstrapper echoed that in their signatures — but none of those bodies touch anything beyond KernelInterface: an Application to run console commands through, a container, and shutdown(). All relaxed. FixtureKernelMethodProvider already worked this way, duck-typing getFixtures() off a plain KernelInterface with a docblock noting kernels are expected to move away from these methods anyway.

The bigger one was this bundle's own hooks. FixtureHook autowires FixtureImporter (registered by IbexaTestKernel::loadServices()), and both purge hooks reference ibexa.spi.search (registered by IbexaCoreBundle). So merely registering IbexaTestCoreBundle in a minimal kernel blew up container compilation before any test ran — relaxing the type alone would have got you nowhere.

#43 already added RemoveUnsatisfiableHooksPass for DatabaseSchemaHook, so this just adds the other three to its requirements map. One mechanism for every built-in hook rather than a special case per hook, and a kernel ends up with HooksExecutor plus whatever it can actually satisfy.

For QA:

KernelProviderTest gained testAcceptsAnyKernelInterfaceImplementation, booting a plain Kernel subclass that is deliberately not an IbexaTestKernel (39 tests total).

Behaviour checked in both directions:

  • full kernel (ibexa/activity-log) — all four hooks still registered, 124 tests / 855 assertions with the same single pre-existing failure as before, i.e. the pass removes nothing when the services are present
  • minimal kernel (ibexa/doctrine-migrations, no ibexa/core dependency at all) — all four hooks dropped, HooksExecutor present with zero hooks, suite green at 8 tests / 18 assertions

@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch from 54d82db to b9473f4 Compare September 8, 2026 21:39
@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch from b9473f4 to ac46fa1 Compare September 9, 2026 07:37
@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch from ac46fa1 to 54d5fca Compare September 9, 2026 08:05
@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch 2 times, most recently from dee38b6 to e7b79c2 Compare September 9, 2026 10:01
@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch from e7b79c2 to b717cc5 Compare September 9, 2026 10:16
@Steveb-p
Steveb-p marked this pull request as ready for review September 9, 2026 12:00
@Steveb-p Steveb-p changed the title Let Bootstrapper run against any KernelInterface, not just IbexaTestKernel Allowed Bootstrapper to run against any KernelInterface, not just IbexaTestKernel Sep 9, 2026
@Steveb-p Steveb-p changed the title Allowed Bootstrapper to run against any KernelInterface, not just IbexaTestKernel IBX-12530: Allowed Bootstrapper to run against any KernelInterface, not just IbexaTestKernel Sep 9, 2026
@Steveb-p
Steveb-p requested a review from a team September 10, 2026 07:47
@Steveb-p
Steveb-p requested a review from a team September 10, 2026 10:55
@ibexa-workflow-automation-1
ibexa-workflow-automation-1 Bot requested review from konradoboza and removed request for a team September 10, 2026 10:55
Base automatically changed from database-schema-hook-schema-builder to 4.6 September 10, 2026 12:05
…ernel

KernelProvider asserted an IbexaTestKernel subclass and DatabasePreparer/Bootstrapper echoed that
in their signatures, yet none of those bodies touch anything beyond KernelInterface: an Application
to run console commands through, a container, and shutdown(). Relaxed all of them, so a package
testing its own bundle in isolation can bring its own kernel. FixtureKernelMethodProvider already
worked this way, duck-typing getFixtures() off a plain KernelInterface.

That alone wasn't enough: FixtureHook autowires FixtureImporter (registered by
IbexaTestKernel::loadServices()) and both purge hooks reference "ibexa.spi.search" (registered by
IbexaCoreBundle), so a minimal kernel failed container compilation just for registering
IbexaTestCoreBundle. Added them to RemoveUnsatisfiableHooksPass, which already drops
DatabaseSchemaHook the same way -- one mechanism for every built-in hook rather than a special case
per hook.
@Steveb-p
Steveb-p force-pushed the bootstrapper-generic-kernel branch from 5ab9118 to 8f9cca2 Compare September 10, 2026 12:06
@Steveb-p
Steveb-p merged commit 9d20086 into 4.6 Sep 10, 2026
5 checks passed
@Steveb-p
Steveb-p deleted the bootstrapper-generic-kernel branch September 10, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants