acquia / cli

Command-line interface for Acquia Cloud Platform products
https://docs.acquia.com/acquia-cli/
GNU General Public License v2.0
42 stars 47 forks source link

Pass default domain to remote drush command #1694

Closed rmott-littler closed 6 months ago

rmott-littler commented 6 months ago

Motivation As a manager of a dozen applications at Acquia, I want to use acli remote:drush to perform routine tasks (especially uli login) on multiple remote applications without remembering to type the correct --uri every time. Previously with Drupal 7/drush 8/Acquia Cloud API v1 one could use drush acquia-update to easily keep local aliases up-to-date, but this is no longer an option.

Proposed changes Since remote:drush is already fetching the Acquia environment information behind the scenes for the alias provided, it should pass along the default_domain parameter when none is given by the user. Allow the user to continue to provide their own --uri parameter if the default isn't sufficient (on a drush command, the last duplicate parameter wins).

Alternatives considered Manually typing the correct --uri flag when needed for a drush command like uli is redundant and painful.

Testing steps/example usage acli remote:drush site.dev -- status --fields=uri

Before: http://default After: http://sitedev.prod.acquia-sites.com

acli remote:drush site.dev -- uli

Before: http://default/user/reset/1/.../login After: http://sitedev.prod.acquia-sites.com/user/reset/1/.../login

acli remote:drush site.dev -- uli --uri=https://example.com

Before: https://example.com/user/reset/1/.../login After: https://example.com/user/reset/1/.../login (no change; the user override was unaffected)

danepowell commented 6 months ago

Nifty; thanks for the PR!

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.18%. Comparing base (54694fb) to head (9031159). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1694 +/- ## ============================================ + Coverage 91.16% 91.18% +0.01% - Complexity 1783 1784 +1 ============================================ Files 122 122 Lines 6363 6366 +3 ============================================ + Hits 5801 5805 +4 + Misses 562 561 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.