- Issue created by @tedbow
- πΊπΈUnited States tedbow Ithaca, NY, USA
@longwave pointed out that π Add the ability to install multiple modules and only do a single container rebuild to ModuleInstaller Active was only added to 11.x. The current just switches our phpunit (next major) to use 11.1.x. Assuming this passes test I suggest we commit this and leave the issue to remove the need for the override
- πΊπΈUnited States tedbow Ithaca, NY, USA
Assigning to @wim leers because he needs to .gitlab-ci.yml changes
- π¬π§United Kingdom longwave UK
π CI: update to 1.6.3 of the GitLab CI Template Active also pins to 11.1.x, maybe worth doing that instead as Stylelint is also failing but upgrading the template will eventually unblock that via π Update Stylelint formatter for Stylelint 16 Active
- π¬π§United Kingdom longwave UK
I can reproduce the fail locally with
$ ddev xb-set-core-version 11.x-dev $ ddev test tests/src/Kernel/Plugin/Field/FieldType/ComponentTreeItemTest.php --filter testInvalidField@valid.*props
1) Drupal\Tests\experience_builder\Kernel\Plugin\Field\FieldType\ComponentTreeItemTest::testInvalidField with data set "valid values using static props" (['{"a548b48d-58a8-4077-aa04-da9...ts"}}}', '{"dynamic-static-card2df":{"h...ue"}}}'], []) Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ -Array &0 [] +Array &0 [ + 'field_xb_demo.0' => Array &1 [ + 0 => 'The array must contain a "tree" key.', + 1 => 'The array must contain a "props" key.', + ], +] /var/www/html/web/modules/contrib/experience_builder/tests/src/Kernel/Plugin/Field/FieldType/ComponentTreeItemTest.php:233
- π¬π§United Kingdom catch
At a guess, this might be why:
Drupal\experience_builder\Plugin\ComponentPluginManager: decorates: Drupal\Core\Theme\ComponentPluginManager parent: Drupal\Core\Theme\ComponentPluginManager arguments: ['@entity_type.manager', '@state']
Might be worth trying with π Install modules with container_rebuild_true set by themselves Active applied.
- π¬π§United Kingdom longwave UK
π Install modules with container_rebuild_true set by themselves Active indeed does fix it.
- π¬π§United Kingdom catch
Why is the writing component info to state done as a decorator? Could this not be a separate service that operates on e.g. hook_rebuild()?
- π¬π§United Kingdom longwave UK
π Install modules with container_rebuild_true set by themselves Active landed so this should no longer be necessary - @tedbow can you confirm?
We should still do π CI: update to 1.6.3 of the GitLab CI Template Active .
- πΊπΈUnited States tedbow Ithaca, NY, USA
re #12
landed so this should no longer be necessary - @tedbow can you confirm?
re-running tests on 0.x. https://git.drupalcode.org/project/experience_builder/-/pipelines/364038
there is e2e test that also appears to be failing but that is unrelated. see π Remove leftover wait() in empty canvas e2e test Active
- πΊπΈUnited States tedbow Ithaca, NY, USA
Looks like it is failing for different reason https://git.drupalcode.org/project/experience_builder/-/pipelines/364038
I triggered the jobs to re-run on the same pipeline so I am not sure we can see the previous results
Seeing if I can re-run the pipeline here with a new commit
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Spotted this too yesterday, thanks for jumping in! ππ
- πΊπΈUnited States tedbow Ithaca, NY, USA
If 11.1.x passes I would suggest we use that and then leave this issue as critical. Only so many people can probably work on figuring this out and meanwhile it would good if other issues could get committed. Also maybe 11.x will be receiving a lot of commits while Drupalcon Singapore is going on?
- π¬π§United Kingdom longwave UK
I think we should do π CI: update to 1.6.3 of the GitLab CI Template Active which will test against 11.1 and 10.4 and is currently green, then we can enable OPT_IN_TEST_NEXT_MINOR to add 11.2 but that's not critical to complete until closer to the release of 11.2.0.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Oh, even better! Looking π
(The "+1" was referring to "let's unblock this ASAP".)
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Just reviewed #3480805 in depth, and pleased to say I was able to RTBC it! π Yay for one temporary work-around avoided, and the correct/long-term solution being ready at the same time! π₯³
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
π CI: update to 1.6.3 of the GitLab CI Template Active is in β is there anything left to do here? π
- π¬π§United Kingdom longwave UK
Well, we should now opt in to "next minor" in our CI config and then fix the failure.
- π¬π§United Kingdom longwave UK
longwave β changed the visibility of the branch 3492722-phpunit-next-major to hidden.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Nice, that seems to be uncovering either not previously observed bugs or
11.2.x
has changed in some way β because tests are failing withunmet config dependencies
! π¬Also:
Warning: Undefined array key "label" in /builds/project/experience_builder/web/core/lib/Drupal/Core/Field/FormatterBase.php on line 80
β¦ this seems an upstream bug in core?
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
This is less urgent than many other MRs, so unassigning @longwave.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Thanks to @longwave, closed π CI: also test against next minor: 11.2.x aka Drupal 11.x HEAD Active as a duplicate.
- Status changed to Needs work
11 days ago 9:58pm 25 April 2025 - π¬π§United Kingdom longwave UK
@penyaskito found that FieldTypeUninstallValidatorTest fails in HEAD as well
1) Drupal\Tests\experience_builder\Kernel\FieldTypeUninstallValidatorTest::testUninstall Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by <em class="placeholder">xb_test_config_node_article</em> have unmet dependencies: <em class="placeholder">field.field.node.article.field_xb_test (experience_builder.component.sdc.experience_builder.image, experience_builder.component.sdc.experience_builder.my-hero, experience_builder.component.sdc.experience_builder.two_column)</em> /var/www/html/web/core/lib/Drupal/Core/Config/UnmetDependenciesException.php:100 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php:581 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php:132 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:209 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83 /var/www/html/web/modules/contrib/experience_builder/tests/src/Kernel/FieldTypeUninstallValidatorTest.php:60 2) Drupal\Tests\experience_builder\Kernel\FieldTypeUninstallValidatorTest::testUninstallXbFieldMultipleEntityTypes Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by <em class="placeholder">xb_test_config_node_article</em> have unmet dependencies: <em class="placeholder">field.field.node.article.field_xb_test (experience_builder.component.sdc.experience_builder.image, experience_builder.component.sdc.experience_builder.my-hero, experience_builder.component.sdc.experience_builder.two_column)</em> /var/www/html/web/core/lib/Drupal/Core/Config/UnmetDependenciesException.php:100 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php:581 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php:132 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php:209 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83 /var/www/html/web/modules/contrib/experience_builder/tests/src/Kernel/FieldTypeUninstallValidatorTest.php:103
probably due to π Add the ability to install multiple modules and only do a single container rebuild to ModuleInstaller Active
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Disclaimer: I usually work with 11.x HEAD, so was surprised I didn't see this before.
The problem is that if installing several modules, after experience_builder is installed no rebuild is happening, so it's not triggering the discovery of sdc components/blocks and its related config creation, and
xb_test_config_node_article
depends on that.I thought we might need to flush caches on
hook_install
, but we are actually doing that already.
That's why the issue only happens in (some) kernel tests.So we have two options:
1) Include the config in
xb_test_config_node_article
(meh π)
2) Document and workaround it in kernel tests (βΊοΈ)e.g Never use
$this->container->get('module_installer')->install(['experience_builder', 'xb_test_config_node_article', 'sdc_test']);
but instead use
$this->container->get('module_installer')->install(['experience_builder', 'sdc_test']); $this->container->get('module_installer')->install(['xb_test_config_node_article']);
- π¬π§United Kingdom catch
container_rebuild_required = TRUE
in xb.info.yml might be enough. See π Consider defaulting requires_container_rebuild to FALSE Active . - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
Even better, thanks!
- π¬π§United Kingdom longwave UK
#32 onwards is a core bug in the module installer since π Add the ability to install multiple modules and only do a single container rebuild to ModuleInstaller Active that means that modules that depend on XB components cannot be installed at the same time that XB itself is installed. This is because XB creates config objects on the fly, that do not exist until after XB is actually installed, but
::install()
does this (simplified):// Gather full set of modules to be installed ... // Check the validity of the default configuration. This will throw // exceptions if the configuration is not valid. $config_installer->checkConfigurationToInstall('module', $module_list); // Group modules based on container_rebuild_required flag ... // Install modules in groups foreach ($module_groups as $modules) { $this->doInstall($modules, $installed_modules, $sync_status); }
Because we check the config dependencies of the entire set before anything is installed, the XB config entities can never exist by this point.
Locally, moving
checkConfigurationToInstall()
into the later loop makes the tests pass for me, so I will open a core issue to change this. - π¬π§United Kingdom longwave UK
Wrote all this up and was about to open a new issue, then found that I opened π Modules that create config cannot be installed alongside modules that depend on that config Active back in January and completely forgot about it!
Alternatively though: XB can ship
experience_builder.component.sdc.experience_builder.*
as default config to work around this, at least for the XB-provided set of components - given this will be created at install time anyway, why can't we ship with it? - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
I had the same question as #36 at #33, and catch responded in #34.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
given this will be created at install time anyway, why can't we ship with it?
Can't really argue with that.
Thanks to
\Drupal\Tests\experience_builder\Functional\DefaultConfigTest
it should be no pain at all; our tests would tell us. Or they should. If not, then we would need an explicit test for that. - π¬π§United Kingdom longwave UK
Yes I tried #34, it doesn't help because
container_rebuild_required
is not considered until aftercheckConfigurationToInstall()
is called, which is where the error is triggered - see the pseudocode in #36. - π¬π§United Kingdom longwave UK
Not sure 30291899 is a valid test because
SingleDirectoryComponent::updateConfigEntity()
only updatesprop_field_definitions
, not labels - if we don't have a child of π± [META] Production-ready ComponentSource plugins Active to deal with this we need one. - π¬π§United Kingdom longwave UK
All green! Unsure if we want to make next minor fail CI or if we should just keep an eye on it manually.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
#44: how about we mark this CI job to allow failures? Then we can at least see where we're at. Manually triggered on MRs, automatically on commit?
- π¬π§United Kingdom longwave UK
PHPUnit (next minor) already allows failures. Pushed a change to disable
_FOR_EVERY_MR_COMMIT
for the next minor matrix so we can run them manually.Opened π Handle update and delete of SingleDirectoryComponent `Component`s, plus missing config dependencies Active as a sister issue of π Handle update and delete of Block component config entities Active .
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I wanted to merge this, but:
We want only 1 of the 4 for the next minor, too.