Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The recent update to PHP 8.1.5 has caused ComposerHooksTest to break on 10.0.x because also included is an update to the local Composer exectuable.
Steps to reproduce
Locally update your composer to the latest version
Run ./vendor/bin/phpunit -v core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php --filter testComposerHooks
Proposed resolution
Change fixtures/drupal-assets-fixture:dev-master
to fixtures/drupal-assets-fixture:dev-main
in ComposerHookTest.php
.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3283795-2.patch | 2.08 KB | alexpott |
|
Comments
Comment #2
alexpottThe attached patch fixes this on composer 2.3.6 and also it is not broken on 2.3.2 - I think this was broken by the changes to 2.3.3 - see https://github.com/composer/composer/blob/main/CHANGELOG.md
Yep - if I run head with composer 2.3.2 it passes but with 2.3.3 it fails. Patch attached passes on both.
Comment #3
bircherI think our tests would also be broken with composer 2.2.11 since the alias has also been removed there.
Comment #4
alexpotthttps://dispatcher.drupalci.org/job/drupal8_core_regression_tests/56336/... shows that head is broken - so we need to land this ASAP.
Comment #5
alexpottI suspect we have the same issue on PHP 8.1 on 9.4.x and 9.5.x. Also I think this should be backported to 9.3.x in case of a security release.
Comment #7
catchCommitted/pushed to 10.0.x, cherry-picked to 9.5.x and 9.4.x
Leaving this patch to be ported for 9.3.x and tagging needs release manager review - because we always branch off the tag for security releases, committing to 9.3.x doesn't automatically help, but maybe we can tag an extra release or combine this change with the first security release... or something.
Comment #8
benjifisherHere are the results from https://www.drupal.org/pift-ci-job/2395338:
It looks as though the problem is a result of renaming
master
tomain
... in the fixtures? The patch in #2 updates the test to usemain
, which seems like the right fix.I do not see how this relates to the composer or PHP version. Did composer previously guess at this renaming or is the composer version a red herring? I get the same results (with and without the patch) locally with composer 2.3.5 and PHP 8.1.5.
+1 for RTBC, although I still have questions.
Comment #9
alexpott@benjifisher
Are you absolutely sure about that? I don't get the same results at all. On 94b5d57502 (the commit prior to the fix) with the latest composer (2.3.6) running
./vendor/bin/phpunit -v core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ComposerHookTest.php --filter testComposerHooks
fails and on HEAD 10.0.x it does not.This fail was caused by updating the DrupalCI PHP 8.1 container... that resulted in composer that is part of the build being updated. If you run the test on 94b5d57502 with composer 2.3.2 it will pass. The breaking change occurs in 2.3.3.
Comment #10
benjifisher@alexpott:
I think I was ambiguous:
What I meant was:
All good?
Comment #11
benjifisherJust for fun (since DDev makes it so easy) I installed composer 2.3.2 and confirmed that the test passes with 94b5d57502.
Earlier, I looked at the link in #2, but I missed that it was a change introduced in 2.3.3. I assume it is this one:
Comment #13
catchDiscussed the @xjm, last time we left the commit on the dev branch and included it in the release, so normal backporting is useful after all. Cherry-picked to 9.3.x too.