cli icon indicating copy to clipboard operation
cli copied to clipboard

CLI-1398: ACLI does not copy the paths defined in installer-paths when {$name} is used

Open camoa opened this issue 5 months ago • 4 comments

Describe the bug When using acli push:artifact to deploy code ACLI by default does not copy the compiled assets of the custom themes.

Acquia provided a solution per this doc: https://docs.acquia.com/acquia-cloud-platform/add-ons/acquia-cli/known-issues#section-artifact-does-not-include-front-end-build-assets

This does not work when the installer path is created like this in composer.json:

      "docroot/themes/custom/{$name}/css": [
        "type:npm-asset"
      ],

The files are not copied.

This type of installer path is important when using several tcustom themes like multisites and ACSF.

To Reproduce Steps to reproduce the behavior:

  1. Add an installer-path (per the docs) to composer.json as shown in the description.
  2. Add the necessary step (composer script called pre-acli-push-artifact) that compiles the them assets.
  3. commit your changes
  4. test acli push:artifact
  5. Check the messages you will see a message like: "Forcibly coping /themes/custom/css"

Expected behavior ACLI should follow the standard use of installer paths and when finding {$name} in a path definition, it should create 1 entry per each subfolder or use some sort of * pattern to copy all possible ocurrences of the folders.

Screenshots

> acli push:artifact eecospina.dev --no-push --no-sanitize -vvvv |grep -i forcibly
[debug] Forcibly adding vendor
[debug] Forcibly adding docroot/core
[debug] Forcibly adding docroot/modules/contrib
[debug] Forcibly adding docroot/modules/custom
[debug] Forcibly adding docroot/profiles/contrib
[debug] Forcibly adding docroot/profiles/custom
[debug] Forcibly adding docroot/themes/contrib
[debug] Forcibly adding docroot/themes/custom
[debug] Forcibly adding docroot/themes/custom/dist
[debug] Forcibly adding docroot/themes/custom/css
[debug] Forcibly adding docroot/themes/custom/js
[debug] Forcibly adding docroot/libraries/mmenu
[debug] Forcibly adding docroot/libraries
[debug] Forcibly adding drush/Commands
[debug] Forcibly adding docroot/.csslintrc
[debug] Forcibly adding docroot/.eslintignore
[debug] Forcibly adding docroot/.eslintrc.json
[debug] Forcibly adding docroot/.ht.router.php
[debug] Forcibly adding docroot/.htaccess
[debug] Forcibly adding docroot/example.gitignore
[debug] Forcibly adding docroot/index.php
[debug] Forcibly adding docroot/INSTALL.txt
[debug] Forcibly adding docroot/README.md
[debug] Forcibly adding docroot/robots.txt
[debug] Forcibly adding docroot/update.php
[debug] Forcibly adding docroot/web.config
[debug] Forcibly adding docroot/sites/README.txt
[debug] Forcibly adding docroot/sites/development.services.yml
[debug] Forcibly adding docroot/sites/example.settings.local.php
[debug] Forcibly adding docroot/sites/example.sites.php
[debug] Forcibly adding docroot/sites/default/default.services.yml
[debug] Forcibly adding docroot/sites/default/default.settings.php
[debug] Forcibly adding docroot/modules/README.txt
[debug] Forcibly adding docroot/profiles/README.txt
[debug] Forcibly adding docroot/themes/README.txt
[debug] Forcibly adding docroot/autoload.php

Additional context In https://github.com/acquia/cli/blob/456c3ba85c1c08dfd01e1ea333fafb7a0bd9c06f/src/Command/Push/PushArtifactCommand.php#L427 the {$name is replaced with and empty string.

camoa avatar Sep 12 '24 01:09 camoa