Problem/Motivation

The upcoming version 2.2.0 of composer asking to configure allowed plugins for drupal/drupal

web $ composer i -o
composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
drupal/core-project-message contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-project-message" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
drupal/core-vendor-hardening contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-vendor-hardening" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
> Drupal\Composer\Composer::ensureComposerVersion

Also it needs to check compatibility for core provided plugins

Steps to reproduce

get core from git and use composer self-update --preview && composer install -o

Proposed resolution

- fix list of of allowed plugins
- check compatibility for core's plugins

Remaining tasks

patch/review/commit
- may use change record or release notes

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

Added compatibility with Composer 2.2

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
FileSize
447 bytes

patch for allowed plugins

andypost’s picture

composer updates and plugin-api already using ^1 || ^2

+------------------------+---------+---------+
| Production Changes     | From    | To      |
+------------------------+---------+---------+
| laminas/laminas-stdlib | 3.6.1   | 3.6.2   |
| symfony/var-dumper     | v5.4.0  | v5.4.1  |
| twig/twig              | v2.14.7 | v2.14.8 |
+------------------------+---------+---------+

+---------------------------+--------+---------+
| Dev Changes               | From   | To      |
+---------------------------+--------+---------+
| composer/composer         | 2.1.12 | 2.1.14  |
| composer/xdebug-handler   | 2.0.2  | 2.0.3   |
| phpspec/prophecy          | 1.14.0 | v1.15.0 |
| phpunit/php-file-iterator | 2.0.4  | 2.0.5   |
| composer/pcre             | NEW    | 1.0.0   |
+---------------------------+--------+---------+
Gábor Hojtsy’s picture

Status: Needs review » Needs work

I think the patch in #2 looks useful based on your report, but updating dependencies should not be mixed with it unless those improve composer 2.2 support which is not evident from your comment/patch :D

Gábor Hojtsy’s picture

Issue summary: View changes

Adding your composer output to the issue summary from chat to make it easier to understand what the extent of the "incompatibility" is.

andypost’s picture

Status: Needs work » Needs review
Related issues: +#3253943: Update dependencies for 9.4.x
FileSize
447 bytes

Filed separate issue #3253943: Update dependencies for 9.4.x

re-uploading patch from #2 as it should go last for rtbc

Spokje’s picture

Status: Needs review » Reviewed & tested by the community

RTBC #2 patch, which only adds an "allow-plugins" section to the root composer.json.
In it are the three plug-ins that need to be allowed, as described in the IS.

With composer < 2.2 this section is merrily ignored, so no harm will be done upon adding this section IMHO.

catch’s picture

Status: Reviewed & tested by the community » Needs work

This needs a 10.0.x-specific patch.

Spokje’s picture

Spokje’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Looks identical to the 9.x patch, thanks.

andypost’s picture

+++ b/composer.json
@@ -49,6 +49,11 @@
         "autoloader-suffix": "Drupal9",
         "platform": {
             "php": "8.0.0"
+        },
+        "allow-plugins": {

Filed follow-up #3254149: Remove config.autoloader-suffix from composer.json

it probably makes sense to sort this sections of composer in other follow-up

catch’s picture

Version: 9.4.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x and cherry-picked to 9.4.x and 9.3.x, thanks!

  • catch committed 38c73bd on 10.0.x
    Issue #3253683 by andypost, Spokje, Gábor Hojtsy: Improve compatibility...

  • catch committed 109863e on 9.4.x
    Issue #3253683 by andypost, Spokje, Gábor Hojtsy: Improve compatibility...

  • catch committed fcc9a6b on 9.3.x
    Issue #3253683 by andypost, Spokje, Gábor Hojtsy: Improve compatibility...
catch’s picture

Status: Fixed » Closed (fixed)

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