Conversation
…r hook The baseline repository content (DefaultFixtureProvider's test_data.yaml) has a second source: on the Doctrine Migrations install path, ibexa/core's ImportDataMigration inserts the same rows from its import-data SQL. Importing the fixture on top of that collides on the same primary keys, so the bootstrapper needs a way to leave it out. Routing that through FixtureHook's provider chain doesn't hold up. The chain is a replacement mechanism - one provider wins and decides what a package contributes - while the baseline is an "always", independent of that choice. Two ways it gets lost: a provider composing the baseline into its own output can dissolve it (corporate-account unwraps via Fixture::load() and re-merges into an anonymous Fixture), and setting ibexa.test.fixture_files outranks the kernel-method provider and drops it outright. The baseline is now imported by BaseFixtureHook (priority 950, between the schema hooks and FixtureHook), reading DefaultFixtureProvider directly. Its load_base_fixture option defaults to true; the Doctrine Migrations bootstrap sets it to false. FixtureHook and the chain now cover package fixtures only, and IbexaTestKernel::getFixtures() no longer yields the baseline - it is deprecated and BC-only, and the hook covers every kernel regardless. Pairs with ibexa/core's AppendOnlyFixture, which a package fixture needs when it writes into tables the baseline already populates - otherwise FixtureImporter truncates those tables and takes the baseline's rows with it. Of the packages checked, only corporate-account overlaps.
Steveb-p
force-pushed
the
feature/append-only-fixtures-4.6
branch
from
September 21, 2026 09:21
a0b0cac to
5a38725
Compare
IbexaTestCore::loadFixtures() imports whatever getFixtures() yields, with no hooks involved, so emptying IbexaTestKernel::getFixtures() left that path with no baseline at all. IbexaTestCore now supplies it - but only when the kernel is this package's IbexaTestKernel, since any other IbexaTestKernelInterface implementation carries a baseline of its own and would end up importing two. Also made BaseFixtureHookTest's assertion tier-portable (it named ezcontentobject, which does not exist at 5.0+) and dropped a redundant explicit service argument that autowiring already resolves.
Steveb-p
force-pushed
the
feature/append-only-fixtures-4.6
branch
from
September 21, 2026 13:37
010b635 to
4e15e5c
Compare
A test case that installs the schema or imports fixtures in setUp() cannot be wrapped in
a transaction, so DAMADoctrineTestBundle - and per-test rollback generally - is off the
table for any suite that does it. The Bootstrapper already does both once per run via
DatabaseSchemaHook, BaseFixtureHook and FixtureHook, which is what makes transactional
tests possible.
Deprecated as of 4.6.31, for removal in 6.0:
IbexaTestCoreInterface / IbexaTestCore loadSchema(), getSchemaFiles(),
loadFixtures(), getFixtures()
IbexaTestKernel getSchemaFiles(), getFixtures()
The kernel pair covers the declaration side: fixtures belong in the
ibexa.test.fixture_files parameter or a tagged FixtureProviderInterface, and schema files
are not consulted at all under the Bootstrapper, which builds the schema from the
SchemaBuilderEvent instead. IbexaTestKernel::getFixtures() already carried an ad-hoc tag;
it is reworded to the same form as the rest.
Annotations only, in the format from PHP Conventions: Deprecation standards - no
behaviour change, and no trigger_deprecation() yet.
Steveb-p
force-pushed
the
feature/append-only-fixtures-4.6
branch
from
September 21, 2026 16:01
4e15e5c to
51db9dc
Compare
This was referenced Sep 23, 2026
Open
Open
Open
Steveb-p
marked this pull request as ready for review
September 23, 2026 14:19
ibexa-workflow-automation-1
Bot
requested review from
ViniTou,
alongosz,
barw4,
bnowak,
ciastektk,
mikadamczyk and
wiewiurdp
and removed request for
a team
September 23, 2026 14:28
ibexa-workflow-automation-1
Bot
requested review from
konradoboza and
tbialcz
September 23, 2026 14:28
alongosz
reviewed
Sep 23, 2026
| } | ||
|
|
||
| /** | ||
| * @deprecated 4.6.31 The "IbexaTestCore::loadSchema()" method is deprecated, will be removed in |
Member
There was a problem hiding this comment.
ATM 4.6.33, but given we don't release test-core, not sure if that makes sense either.
Collaborator
Author
There was a problem hiding this comment.
Changed to 4.6.33 across the whole PR.
…nstall test_data.yaml gave language ID 2 the locale eng-US, while ibexa/core's cleandata.sql - and the ImportDataMigration derived from it - gives ID 2 eng-GB. Nothing loaded both datasets into one database, so the contradiction was invisible until the Doctrine Migrations install path started seeding the test database from the install baseline. Swaps the locales on IDs 2 and 8, so ID 2 is eng-GB as in a real install and eng-US moves to ID 8. Language masks are untouched - the IDs keep their bit values, only the locale each one maps to changes - so existing content stays in the same rows and the same masks.
konradoboza
approved these changes
Sep 24, 2026
…efault install" This reverts commit be8ced6.
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.
Related PRs:
Description:
The baseline repository content in
test_data.yamlhas a second source: on the DoctrineMigrations install path,
ibexa/core'sImportDataMigrationinserts the same rows from itsimport-data SQL. Both write the same primary keys, so importing the fixture on top of the
migration collides — the bootstrapper needs a way to leave it out.
My first attempt did that with a marker (
BaseFixture) plus askip_base_fixtureoption onFixtureHook, and it doesn't hold up. The provider chain is a replacement mechanism — oneprovider wins and decides what a package contributes — while the baseline is an "always",
independent of that choice. Putting the two in one list makes the baseline something a package
can lose by accident, in two ways.
corporate-accountcomposes it into its own output byunwrapping with
Fixture::load()and re-merging into an anonymousFixture, so the marker isgone before the hook ever sees it. And setting
ibexa.test.fixture_filesoutranks thekernel-method provider (100 vs 0), so it drops the baseline outright — nothing uses that
parameter yet, but it's the mechanism we want people to move to.
So the baseline is now its own hook.
BaseFixtureHookreadsDefaultFixtureProviderdirectlyand imports it at priority 950 — after the schema is in place, before the package fixtures
layered on top.
load_base_fixturedefaults totrue; the Doctrine Migrations bootstrap setsit to
false.FixtureHookand the chain now mean package fixtures only, andIbexaTestKernel::getFixtures()stops yielding the baseline — it's deprecated and BC-only, andthe hook covers every kernel regardless of what that method does.
Nothing breaks in the interim for packages that still
yield from $this->defaultProvider: thebaseline just gets imported twice, which truncates and reinserts the same rows. Wasteful, not
wrong. Those
yield fromlines can come out per package afterwards.One case does need a change though —
corporate-accountmerges its fixtures into a singlesynthetic one precisely because
FixtureImportertruncates before inserting, andtest_company.yamlwrites into six tables the baseline also populates(
ezcontentobject,_attribute,_link,_name,_tree,_version). Once the baseline is aseparate
import()call, that has to become anAppendOnlyFixture— which is the matching piecein ibexa/core#785. I checked the other packages' fixture tables;
cart,order-managementanddiscountsare fully disjoint from the baseline, so they're unaffected.One more thing fell out of this, unrelated to the hook split itself.
test_data.yamlhad languageID 2 as
eng-USand ID 8 aseng-GB, whileibexa/core'scleandata.sql- and theImportDataMigrationgenerated from it - gives ID 2eng-GB, and doesn't define ID 8 at all.Nothing ever loaded both datasets into the same database, so the two mappings never had to agree
with each other. Once the baseline comes from the install data and the package fixtures are layered
on top of it, they do.
So I swapped them: ID 2 is
eng-GBas in a real install, andeng-USmoves to ID 8. It's a largediff (286 lines each way) because every serialized locale string in the file has to follow the ID
it's attached to, but it's a pure string swap - the IDs and the language masks are untouched, so
content stays in the same rows with the same masks.