Automatically unpack recipes on project creation

Created on 13 May 2025, 1 day ago

Problem/Motivation

To facilitate easier update paths, we don't want sites to keep Drupal CMS's recipes in their dependencies. Recipes are meant to be one-and-done; you bring it in, apply it, then delete it and get on with your life.

Core recently introduced a Composer plugin for automatically unpacking recipes upon project creation. If we adopt it, then here's what will happen:

New sites

Upon project creation with composer create-project, the recipes will be physically found in the recipes directory, and will be apply-able by Drupal CMS's installer, but they will not still be listed in composer.json. That means, if a project is created and then committed to a Git repository, any subsequent composer install invocations will NOT reinstall the recipes.

This is probably the riskier proposition, since deployments that depend on doing a composer install at the remote end, then reapplying the recipes, will not work.

Existing sites

Existing sites are unaffected, since this plugin needs to be added to the top-level composer.json. We will have to provide instructions to do that. Even with the plugin enabled, existing sites' recipes will not be unpacked automatically; that needs to be done at the command line.

Proposed resolution

Add the plugin to the project template's composer.json.

This will very definitely need careful consideration of the site owner experience for new and existing sites, along with release notes, a detailed and clear change record, and probably documentation for DevOps-ey site owners.

That means I'd ideally like the following sign-offs:

  • @tim.plunkett
  • @phenaproxima
  • @pameeela
  • Docs Lead (@eojthebrave or @amber himes matz)
  • A core release manager, probably @catch

User interface changes

None.

Configuration changes

Only to the top-level composer.json.

✨ Feature request
Status

Active

Component

General

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
  • Needs release note

    The major change should have a special release note written to summarize the importance of the change. See Write a release note for an issue.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡¬πŸ‡§United Kingdom catch

    This is probably the riskier proposition, since deployments that depend on doing a composer install at the remote end, then reapplying the recipes, will not work

    Trying to think of a use-case for this workflow, but struggling a bit.

    I would expect that people would apply the recipes locally, export configuration, and commit the configuration to git, then import it on production (same as config changes without recipes). Or.. if they're building a recipe-based hosted demo or similar that they'd commit the recipes themselves to git. As long as those two work, then breaking a workflow of composer install locally + recipe apply remote without either exporting config or committing to git seems fine.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Re #5: Yeah, I'm not necessarily saying it's a workflow that anyone would actually use, but I merely raise it because people have all sorts of wonky workflows and this could be a major change to some of them. I guess this is merely a call for strong documentation.

Production build 0.71.5 2024