Skip to content

Obscure BLT dependency leads to unnecessary drs:init:settings invokation #85

@ekubovsky-webfirst

Description

@ekubovsky-webfirst

Describe the bug
As BLT is being phased out, we entirely replaced BLT with other tools. DRS is one of such tools. In Acquia pipelines, when a composer finishes install command, DRS plugin kicks in and runs drs:init:settings, which in its turn adds the following files to the settings directory:

-r--r----- 1 www-data doigov2 1.5K Feb 26 19:19 default.includes.settings.php
-r--r----- 1 www-data doigov2 5.2K Feb 26 19:19 default.local.settings.php
-r--r----- 1 www-data doigov2 5.2K Feb 26 19:19 local.settings.php

Excerpt from the logs:

composer install --no-dev -o --no-ansi

...

 - Skip [web-root]/sites/development.services.yml: disabled
 - Append to [project-root]/.editorconfig from .overrides.editorconfig

No security vulnerability advisories found.

 > /mnt/tmp/local.prod/source/vendor/bin/drush drs:init:settings

 [success] Settings generated successfully for site 'default'.
 [notice] Hash salt already exists.

...

Doesn't look like these files belong on any environment other then local development.

This seems to be triggered in this part of the Plugin.php:

  /**
   * Includes Acquia recommended settings post composer update/install command.
   */
  public function onPostCmdEvent(): void {
    // Only install the template files, if the drupal-recommended-settings
    // plugin is installed, with drupal project.
    if ($this->settingsPackage && $this->getDrupalRoot() && !$this->bltUpdated) {
      $vendor_dir = $this->composer->getConfig()->get('vendor-dir');
      $this->executeCommand(
        $vendor_dir . "/bin/drush drs:init:settings", [],
        TRUE
      );
    }
  }

To Reproduce
Run a simple Acquia pipeline with the following step included:

events:
  build:
    steps:
      - setup-env:
          type: script
          script:
            - composer clear-cache && composer install --no-dev -o --no-ansi

Expected behavior
The drs:init:settings command should not be executed automatically.

Screenshots
none

Environment
Acquia pipelines

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions