This issue is part of the composer initiative: #2958021: Proposal: Composer Support in Core initiative
Problem/Motivation
The vendor cleanup scripts were moved into a Composer plugin in #3057094: Add Composer vendor/ hardening plugin to core. This is a follow-on issue to that task.
The original sanitization scripts still exist in the repository at Drupal\Core\Composer\Composer::vendorTestCodeCleanup()
, and are called as an event script in drupal/drupal's composer.json like this:
"scripts": {
"post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
"post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
These scripts are now deprecated, and should be removed.
Proposed resolution
Once the deprecated scripts are no longer being called, they should be removed. There are three potential places where these scripts may be called:
- From sites installed from a tarball download of Drupal
- From git clones of the Drupal repository (core development)
- External sources
The first set of calls will be removed by #2982680: Add composer-ready project templates to Drupal core. When the Drupal template projects are created, they will use the new Vendor Hardening plugin rather than the cleanup scripts. Once tarballs are generated from the template projects, the scripts will be unused in tarball-based sites (managed via `drush pm-update` etc.).
The second use-case is Drupal core development. To stop using the scripts during core development, the Vendor Hardening plugin will need to be added as a "path" repository of the root-level composer.json file of drupal/drupal, and the references to the scripts in the "scripts" section will need to be removed. This work can be done as part of this issue.
The final place where these scripts may be called is from external sources, e.g. community-managed Drupal template projects. These cleanup scripts are not needed for Drupal sites that utilize a relocated document root, so drupal-composer/drupal-project, for example, does not call these scripts. At the moment, there are no known examples of external projects that use these scripts. If there are any that exist, then this work cannot be done until Drupal 9.
Remaining tasks
Decide on the timing of when to do this work.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
tbd