Problem/Motivation
Bump composer minimum version requirement.
\Drupal\Tests\package_manager\Kernel\ComposerPatchesValidatorTest::testErrorDuringPreApplyis failing on my local and passing for @wim.leers as he is having higher composer version i.e 2.5.2 and I am on 2.4.1
with error:

Why I think this can be a reason behind the test failure:
In active directory we actually do the composer install and it creates the vendor directory and install.json and install.php which is not the case with stage directory so something has changed with the newer version of composer, which is doing the extra check so we need to do the require “composer-plugin-api” to meet that requirement in stage.
Steps to reproduce
below is a screen shot of things I tried:
- I was on local version 2.4.1 and
\Drupal\Tests\package_manager\Kernel\ComposerPatchesValidatorTest::testErrorDuringPreApplywas failing for me I tried updating version to 2.4.2 and 2.4.3 and then finally to 2.4.4 which made the tests pass. So we will need minimum 2.4.4 composer version. - Other reason to support this is https://endoflife.date/composer which shows that support for 2.4.1-2.4..3 are ended also for 2.4.4 has ended so that should be decided if we want to change the minimum version requirement to 2.4.4 or 2.5.*
support for composer 2.2.21 is not ended yet but it's going to end in 10 months and we are going to support drupal 10.1.* after that. So we can bump the minimum version constraint to maybe 2.4.4 or 2.5.1
set composer version to 2.4.1 and try running the test it should be fail, with the following error message:
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Screenshot 2023-02-23 at 4.25.02 PM.png | 453.28 KB | yash.rode |
| Screenshot 2023-02-23 at 11.34.39 AM.png | 181.81 KB | yash.rode |
Issue fork automatic_updates-3343889
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
Comment #3
wim leersand
⇒ 2.5.2 is fine.
Comment #4
yash.rode commentedComment #5
wim leers→ Can you please find the official source and link that instead?
Looking forward to reading your proposed resolution! 🤓 And that should help you specify a better title too 😊
Comment #6
yash.rode commentedComment #7
yash.rode commentedComment #8
tedbowI am sure we need to do this for the reason stated.
We should support , supported versions of the composer but I don't think that is the only reason those tests are failing.
It looks like we were adding an invalid package. Maybe 1 composer version is more strict on the checks
I think #3344127: Run `composer validate` after FixtureManipulator commits its changes will help with this because I have found it turns up errors like this that we were missing.
Also yash when you create an issue unless it is something we definitely should not work on now please add the
sprinttag as I am am almost always filtering by this, thanksComment #9
tedbowthe current fix in the MR probably belongs in #3344127: Run `composer validate` after FixtureManipulator commits its changes. My guess is it is need to fix a failing test there
Comment #10
yash.rode commentedHi @wim.leers I am unable to find the official documentation for https://endoflife.date/composer. Removed test fix as it is going to be fixed in #3344127: Run `composer validate` after FixtureManipulator commits its changes. @tedbow wants to discuss with you, if we want to remove support for composer 2.2 version.
Comment #11
wim leersWow, that is indeed surprisingly hard to find!
Best sources I could find:
- https://blog.packagist.com/composer-2-2/
- https://github.com/endoflife-date/endoflife.date/commit/c8ee80ba5c7fbf33...
But … yeah … perhaps https://endoflife.date/composer is then the only choice to link to 😞
It makes sense that we want to discuss dropping 2.2 support, but dropping 2.3 support in favor of a newer version @tedbow is fine with. So marking for that.
Also, why are you proposing to require only 2.4.4 if that is already unsupported today? 🤔 Why not require 2.5?
Comment #12
yash.rode commentedI was thinking that the test will pass for all the versions above 2.4.4 but I am more lean towards setting the version to 2.5 and above, so made those changes in the MR (Ignored 2.2 version for the discussion).
Comment #13
wim leers👍
This is now blocked on the discussion @tedbow and you mentioned!
Comment #14
wim leersBut in the meantime, could you already update the title to reflect the current direction? 🙏😊
Comment #15
yash.rode commentedComment #16
wim leers👍 Thanks!
Comment #18
wim leers#3344039: Add a validate() method to ComposerInspector to ensure that Composer is usable moved the constraint to a different place. This MR needs to be updated.
@yash.rode We did discuss this on Friday. In the future, please update the issue accordingly if I didn't. (I didn't because I was working on other issues non-stop after that meeting!)
The conclusion was: support everything listed in https://endoflife.date/composer — that means the LTS (2.2) and the current version (2.5).
Comment #19
yash.rode commentedThe test is passing on my local but failing on drupal CI.
Comment #20
phenaproximaRe-titling for clarity.
Comment #21
wim leers👍 to what @phenaproxima said.
Let's also add an
@seepointing to composer's security advisory.Comment #22
effulgentsia commentedIs the purpose of this issue solely to drop support for potentially insecure Composer versions, or was there something that Composer fixed in 2.2.12 and 2.5, but not in 2.3 or 2.4, and we rely on that fix? If the latter, what was that fix?
Comment #23
phenaproximaWe already don't support Composer 2.2.11 or earlier, because of the security fix made in 2.2.12.
We currently support 2.3.5 and up, but 2.3 and 2.4 are EOL. So this is really just about dropping support for EOLed versions of Composer. Re-titling for clarity.
Comment #24
yash.rode commentedComment #25
wim leersThis still did not yet address what I asked in #21:
Given this is an
alphablocker, fixed that myself and slightly tightened test coverage for maximum confidence: now all boundaries are tested 👍Comment #27
phenaproximaGlad to see this done! 🚀