Problem/Motivation

In #3350568: Drop support for Composer 2.2, require Composer >=2.5.5 I first tried composer self-update. It worked fine … and then it suddenly didn't, due to a regression in Composer 2.5.6. See https://github.com/composer/composer/issues/11480.

https://github.com/composer/composer/releases/tag/2.5.7 fixed this 🚀

So let's test against the latest composer again, so we are notified of changes.

Steps to reproduce

N/A

Proposed resolution

Remove 4 characters from drupalci.yml.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Active » Needs review
wim leers’s picture

Assigned: Unassigned » wim leers

Looks like OverwriteExistingPackagesValidatorTest now fails. Which kinda makes sense — it relates to the changes that 2.5.6/2.5.7 made — at @phenaproxima's request by the way! 😄

wim leers’s picture

Locally, I was not getting

Testing Drupal\Tests\package_manager\Kernel\OverwriteExistingPackagesValidatorTest
F                                                                   1 / 1 (100%)

Time: 00:24.096, Memory: 4.00 MB

There was 1 failure:

1) Drupal\Tests\package_manager\Kernel\OverwriteExistingPackagesValidatorTest::testNewPackagesOverwriteExisting
Failed asserting that Drupal\package_manager\Event\PostCreateEvent Object (...) is an instance of class "Drupal\package_manager\Event\PreApplyEvent".

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/var/www/html/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/PackageManagerKernelTestBase.php:216
/var/www/html/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/OverwriteExistingPackagesValidatorTest.php:155
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

but:

Testing /Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel
E                                                                   1 / 1 (100%)

Time: 00:02.666, Memory: 10.00 MB

There was 1 error:

1) Drupal\Tests\package_manager\Kernel\OverwriteExistingPackagesValidatorTest::testNewPackagesOverwriteExisting
Undefined array key "type"

/Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/src/ComposerInspector.php:326
/Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Traits/ComposerInstallersTrait.php:25
/Users/wim.leers/core/modules/contrib/automatic_updates/package_manager/tests/src/Kernel/OverwriteExistingPackagesValidatorTest.php:33
/Users/wim.leers/core/vendor/phpunit/phpunit/src/Framework/TestResult.php:728

(That was happening for the Chi-teck/drupal-code-generator package.)

So I had to first overcome that.

Fix just pushed.

Now I get the same test failure. 👍

wim leers’s picture

Title: Follow-up for #3350568: install latest version of composer, not 2.5.5, now that 2.5.7 is out and fixed the broken 2.5.6 » Compatibility with Composer 2.5.7
Priority: Normal » Major
Issue tags: +alpha target

The hard failures imply that if you're on the latest stable Composer version, Package Manager/Automatic Updates will not work. That makes this a hard blocker for the alpha AFAICT.

wim leers’s picture

Assigned: wim leers » Unassigned
phenaproxima’s picture

Is there a reason we don't just bump our Composer requirement to ~2.5.7, rather than build in more workarounds for older versions?

wim leers’s picture

There will always be something in upcoming Composer versions that's new/different, won't there be? We gotta draw the line somewhere. 2.5.5 has been out for >2 months. 2.5.7 for a few days.

But … sure, I'm not opposed to that 😇 😄

phenaproxima’s picture

In this case, though, we're specifically bumping it to avoid regressions and things that directly affect us. We're not just bumping it for the sake of bumping it.

So IMHO that's the appropriate course of action, rather than adding even more code to an existing, complex workaround. We should just remove the workaround.

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Needs review » Needs work

WFM!

wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs work » Reviewed & tested by the community

Per discussion just now, sounds like @tedbow disagreed with #10.

tedbow’s picture

re #12 I think since this Drupalcon is coming up next wee and we want people to test and install Auto Updates on an Alpha release(to be cut soon) we should not rely on a version of composer that came out last week. I think it is much likely people will already have a version 2.5.5 that was released over 2 months ago.

Many people may not want to update Composer or won't be able to because of hosting. Also the fix we want in #11455 has a BC warning so it is likely that some sites might not be able to update to it because will make another Composer plugin break. Or if update at Drupalcon they could get weird behavior because it breaks another plugin(if they were to allow it with our module). Also the fix we want already caused 1 regression https://github.com/composer/composer/pull/11481

tedbow’s picture

Status: Reviewed & tested by the community » Needs work

I fix needed otherwise looks good

wim leers’s picture

Assigned: tedbow » Unassigned
Status: Needs work » Reviewed & tested by the community
tedbow’s picture

Merged 3.0.x. Looks good to commit when tests pass. Thanks!

tedbow’s picture

Status: Reviewed & tested by the community » Needs work

Merge conflicts

omkar.podey made their first commit to this issue’s fork.

omkar.podey’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

phenaproxima’s picture

Status: Reviewed & tested by the community » Needs review

One thing: can we at least have a @todo to remove the metapackage workaround when 2.5.7 is the minimum required version of Composer? 🙏

chrisfromredfin’s picture

Status: Needs review » Reviewed & tested by the community

Tested manually and it fixed the problem for me (in DrupalPod / on 2.5.7). I will also close https://www.drupal.org/project/automatic_updates/issues/3365125

phenaproxima’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.