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

CLI-1473: Pull default site if non-interactive. #1839

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

charginghawk
Copy link

If your site has multiple databases, acli pull:db --no-interaction will not pull the default database, which is the logical default.

Motivation

Ran into this issue using ddev pull acquia on a site with multiple databases.

https://github.com/ddev/ddev/blob/master/pkg/ddevapp/dotddev_assets/providers/acquia.yaml#L53

It wasn't pulling the default, which I would expect.

Proposed changes

Use the default site when non-interactive.

Alternatives considered

Testing steps

Try acli pull:db --no-interaction on a site with multiple databases.

  1. Follow the contribution guide to set up your development environment or download a pre-built acli.phar for this PR.
  2. If running from source, clear the kernel cache to pick up new and changed commands: ./bin/acli ckc
  3. Check for regressions: (add specific steps for this pr)
  4. Check new functionality: (add specific steps for this pr)

If your site has multiple databases, acli pull:db --no-interaction will not pull the default database, which is the logical default.
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.91%. Comparing base (2232593) to head (fa97939).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1839   +/-   ##
=========================================
  Coverage     92.91%   92.91%           
- Complexity     1845     1846    +1     
=========================================
  Files           123      123           
  Lines          6960     6963    +3     
=========================================
+ Hits           6467     6470    +3     
  Misses          493      493           

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

Copy link

github-actions bot commented Jan 3, 2025

Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1839/acli.phar

curl -OL https://acquia-cli.s3.amazonaws.com/build/pr/1839/acli.phar
chmod +x acli.phar

@rfay
Copy link

rfay commented Jan 3, 2025

The same is apparently true with pulling files. @danepowell We'd love your review of

Is any of this behavior new, or did nobody ever pipe up before?

@rfay
Copy link

rfay commented Jan 7, 2025

First time I've ever seen an escaped mutant!

Escaped Mutant for Mutator "DecrementInteger"

@danepowell
Copy link
Contributor

Thanks for the PR! I'd prefer to solve this slightly differently so that the question prompt reflects the default, e.g.:

 Choose a site [default]:
  [0] default
  [1] bar
  [2] foo
  [3] g

@danepowell
Copy link
Contributor

danepowell commented Jan 7, 2025

@rfay mutation testing is amazing! In this case, it pointed out a potential bug with array_merge, if the array returned by ls contains a key less than zero. Not likely to happen, but better safe than sorry.

@charginghawk and @rfay please test and let me know if this works for you. You can download a dev build following the instructions in this comment: #1839 (comment)

@danepowell danepowell changed the title Pull default site if non-interactive. CLI-1473: Pull default site if non-interactive. Jan 7, 2025
@anujkaushal anujkaushal requested review from a team and removed request for a team January 8, 2025 15:38
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.

3 participants