Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blt recipes:aliases:init:acquia Erases Local Alias #3265

Closed
augustshultz opened this issue Nov 26, 2018 · 3 comments
Closed

blt recipes:aliases:init:acquia Erases Local Alias #3265

augustshultz opened this issue Nov 26, 2018 · 3 comments
Assignees

Comments

@augustshultz
Copy link

My system information:

  • Operating system type: macOS
  • Operating system version: 10.13
  • BLT version: 9.2.1

Output of blt doctor:

+---------------------------+-------------------------------------------------------+
| Property                  | Value                                                 |
+---------------------------+-------------------------------------------------------+
| %paths.%root              | /var/www/holden/docroot                               |
| %paths.%site              | sites/default                                         |
| %paths.%modules           | sites/all/modules                                     |
| %paths.%themes            | sites/all/themes                                      |
| %paths.%config-sync       | /var/www/holden/config/default                        |
| %paths.%files             | sites/default/files                                   |
| %paths.%temp              | /tmp                                                  |
| %paths.%private           | /var/www/holden/files-private                         |
| admin-theme               | seven                                                 |
| alias-searchpaths.0       | /var/www/holden/drush/sites                           |
| blt-version               | 9.2.1                                                 |
| bootstrap                 | Successful                                            |
| composer-version          | Composer version 1.7.3 2018-11-01 10:05:06            |
| config-sync               | /var/www/holden/config/default                        |
| db-driver                 | mysql                                                 |
| db-hostname               | localhost                                             |
| db-name                   | drupal                                                |
| db-password               | drupal                                                |
| db-port                   | 3306                                                  |
| db-status                 | Connected                                             |
| db-username               | drupal                                                |
| drupal-settings-file      | sites/default/settings.php                            |
| drupal-version            | 8.6.3                                                 |
| drush-alias-files.0       | /var/www/holden/drush/sites/holden.site.yml           |
| drush-cache-directory     | /home/vagrant/.drush/cache                            |
| drush-conf.0              | /var/www/holden/vendor/drush/drush/drush.yml          |
| drush-conf.1              | /var/www/holden/drush/drush.yml                       |
| drush-conf.2              | /var/www/holden/docroot/sites/default/local.drush.yml |
| drush-script              | /var/www/holden/vendor/bin/drush                      |
| drush-temp                | /tmp                                                  |
| drush-version             | 9.5.2                                                 |
| files                     | sites/default/files                                   |
| install-profile           | lightning                                             |
| modules                   | sites/all/modules                                     |
| php-bin                   | /usr/bin/php7.1                                       |
| php-conf.0                | /etc/php/7.1/cli/php.ini                              |
| php-os                    | Linux                                                 |
| private                   | /var/www/holden/files-private                         |
| root                      | /var/www/holden/docroot                               |
| site                      | sites/default                                         |
| stacks.drupal-vm.inited   | true                                                  |
| stacks.dev-desktop.inited | false                                                 |
| temp                      | /tmp                                                  |
| theme                     | bartik                                                |
| themes                    | sites/all/themes                                      |
| uri                       | http://local.holden.com                               |
+---------------------------+-------------------------------------------------------+
+--------------------------------------+--------------------------------------------------------------+
| Check                                | Problem                                                      |
+--------------------------------------+--------------------------------------------------------------+
| ConfigCheck:checkGitConfig           | Git repositories are not defined in blt.yml.                 |
|                                      |   Add values for git.remotes to blt.yml to enabled automated |
|                                      | deployment.                                                  |
| NodeCheck:checkNodeVersionFileExists | Neither .nvmrc nor .node-version file found in repo root.    |
+--------------------------------------+--------------------------------------------------------------+

When I run this command:

blt recipes:aliases:init:acquia

I get the following output:

local alias is overwritten with remote aliases

And I expected this to happen:
remote aliases added to local alias

@mikemadison13 mikemadison13 added Bug Something isn't working 9.2.x and removed Bug Something isn't working labels Nov 30, 2018
@mikemadison13
Copy link
Contributor

@augustshultz i just did a test of this locally, and i have a few observations.

the command does actually provide the warning for me that File <alias.yml> already exists and will be overwritten. Continue? (y/n) y to give me the choice (so it doesn't happen blindly). This is good (in my opinion).

While we certainly could update https://github.com/acquia/blt/blob/10.0.x/src/Robo/Commands/Generate/AliasesCommand.php#L407 to pass the FILE_APPEND option into file_put_contents, my concern here is that will also cause issues with alias generation. Currently, when you run the BLT command to generate these aliases, the resulting file is "always" valid (despite nuking your local alias). If we append to the file, if you run the command back to back, you could easily wind up with an invalid alias file.

I think, while annoying that the local alias is overwritten, we must ensure that the result of recipes:aliases:init:acquia remains valid output.

Suggested Mitigations:

  • have a different machine name locally than your acquia sub (not a bad practice anyway)
  • commit your local alias prior to running recipes:aliases:init:acquia and then use git to merge the resulting aliases with the existing version of your file (preserving the local alias in git).

@augustshultz
Copy link
Author

Perhaps the documentation should simply be updated. It seems odd to me that the command would render you without the ability to target your local install.

Is the suggestion to use a different local name documented somewhere? I would like to read up on that if I could.

Thanks for the response, @mikemadison13.

@mikemadison13
Copy link
Contributor

@augustshultz i can make some doc updates to better clarify what we discussed here. will flag this as a doc ticket.

mikemadison13 added a commit to mikemadison13/blt that referenced this issue Feb 20, 2019
mikemadison13 added a commit that referenced this issue Feb 25, 2019
* Fixes #3265 to expand alias documentation. (#3399)

* Fixes #3401 for 9.2.x to update devel.

* Moved pipelines-deploy from build event to post-deploy event (#3374)

* Docksal documentation (#3268)

* Add links to docsal and ddev pages.

* Updates ignore-existing to include .editorconfig. (#3300)

Fixes #3169 
--------

Changes proposed:
---------
(What are you proposing we change?)

- adds the .editorconfig file to the ignore list for blt updates

* Updating BLT's docs to remove nvm and point to Cog's documentation for theme installation. (#3313)

* Fix broken link to Cloud Hooks docs. (#3331)

* Added steps to install nfs-utils and enable access via firewalld; without it DrupalVm gets stuck at mounting NFS (#3376)

* Updates release and readme docs. (#3382)

* Updates Travis and Pipelines to PHP 7.1 by default.

* Adds FAQ for drush 8/9 permission denied issue. (#3264)

* Add setup instructions for PHPStorm + PHPUnit (#1787) (#3198)

* Update INSTALL.md (#3273)

* Speed up deploys with shallow fetching (#3271)

Before:
```
real	4m11.340s
user	1m3.430s
sys	1m23.638s
```

After:
```
real	3m14.776s
user	0m47.570s
sys	1m6.415s
```

* Fixes #3217 to provide acsf-init-verify as part of git hooks and blt validate. (#3218)

* Updating Drupal VM config versions. (#3328)

* Fixes #3345 to run db updates even when config strategy is none. (#3363)

* Fixes #3362 to better identify why the site URI is not found. (#3369)

* Test tests:acsf:validate (#3392)

* Test tests:acsf:validate

* Delete README.md

Remove cloud hook readme.

* Update AcsfHooksTest.php

* Update AcsfHooksTest.php

* Update DeployTest.php

* Fixes #3383 to backport Pipelines update to 9.2.x.

* Increase wait timeout. (#3163)

* Fixes #3122 to remove misleading jmeter example. (#3230)

* Fixes #3223 to update git docs. (#3226)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants