Add composer/composer as a dev dependency of core so that we can test Composer plugins

Created on 27 May 2019, over 5 years ago
Updated 12 September 2023, over 1 year ago

As part of the Composer initiative, we need to create some Composer plugins within Drupal core. Current issues dealing with Composer plugins are:

Since we're adding Composer-based plugins to Drupal core as subtree-split components, we need to be able to run their tests.

This means adding composer/composer as a dev dependency of those components.

For components, we have historically used the wikimedia merge plugin to merge the dev dependency of components when installing or updating drupal/drupal. We can see this is the case in #2982684: Add a composer scaffolding plugin to core , which seeks to add a scaffold-building plugin to core. This plugin is not expected to be available to Composer, however, within the scope of that issue. Therefore merging the dependencies is fine for now.

In the case of #3057094: Add Composer vendor/ hardening plugin to core , however, we do expect the vendor cleanup plugin to be available to Composer when it installs and updates core locally. We need to a) Allow the plugin to do vendor cleanup during install and update before core's runtime starts, and b) Be able to patch the component and its tests, and then run the tests. This means we can't use merge to inherit the plugin's dev dependencies. That's why that issue changes the drupal/drupal package to have composer/composer as a dev dependency, along with other packages already in use in core. This is acceptable because the plan of the Composer initiative is to replace drupal/drupal with a Composer-based project that emulates the tarball style: #2982680: Add composer-ready project templates to Drupal core

The difference between those two issues explained, it seems as though reviewers here would be familiar with composer/composer since it's used all day every day to build essentially all PHP projects everywhere. :-)

composer/composer

  1. Maintainership of the package: Total ubiquity in the PHP community. Frequent releases.
  2. Security policies of the package: Research continues...
  3. Expected release and support cycles: Frequent releases. Composer 2.0 roadmap does not have an expected release date: https://github.com/composer/composer/milestone/23
  4. Code quality: Mature, high coverage tests, Travis-CI: https://github.com/composer/composer/blob/master/.travis.yml
  5. Other dependencies it would add, if any: As of v.1.8.5, composer/composer brings along:
    • symfony/finder,
    • symfony/filesystem,
    • seld/phar-utils,
    • seld/jsonlint,
    • composer/xdebug-handler,
    • composer/spdx-licenses,
    • composer/ca-bundle
📌 Task
Status

Fixed

Version

8.8 ⚰️

Component
Other 

Last updated about 1 hour ago

Created by

🇺🇸United States mile23 Seattle, WA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024