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

Pass default domain to remote drush command #1694

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

rmott-littler
Copy link
Contributor

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)

@rmott-littler rmott-littler marked this pull request as ready for review March 4, 2024 15:49
@danepowell
Copy link
Contributor

Nifty; thanks for the PR!

@danepowell danepowell enabled auto-merge (squash) March 4, 2024 22:48
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@             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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danepowell danepowell merged commit d7af9cf into acquia:main Mar 4, 2024
13 of 14 checks passed
@rmott-littler rmott-littler deleted the drush-default-domain branch March 4, 2024 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants