Skip to content

Add acli setup: one command from nothing to a local dev environment - #2033

Open
lauriii wants to merge 8 commits into
acquia:mainfrom
lauriii:acli-create
Open

Add acli setup: one command from nothing to a local dev environment#2033
lauriii wants to merge 8 commits into
acquia:mainfrom
lauriii:acli-create

Conversation

@lauriii

@lauriii lauriii commented Aug 5, 2026

Copy link
Copy Markdown
  • New top-level setup command that authenticates, picks an application and
    environment, ensures an SSH key (files or agent), clones code, provisions
    ddev, imports database and files, and opens the site. Every step no-ops
    when already done, so re-running resumes after a failure.
  • Host prerequisites are only git, Docker, and ddev, with one copy-pasteable
    remedy per missing tool; PHP/Composer/Drush/MySQL all run inside ddev.
  • install.sh bootstrap installs the native acli release build (no PHP
    required on macOS arm64/Linux x86_64) with sha256 verification, then runs
    acli setup. CI now publishes .sha256 files with release assets.
  • PullCommandBase::pullDatabase() now returns downloaded dump paths so
    callers can import them through ddev.

Co-Authored-By: Claude Fable 5 noreply@anthropic.comMotivation

Fixes #NNN

Proposed changes

Alternatives considered

Testing steps

  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)

lauriii and others added 6 commits August 5, 2026 10:17
- New top-level setup command that authenticates, picks an application and
  environment, ensures an SSH key (files or agent), clones code, provisions
  ddev, imports database and files, and opens the site. Every step no-ops
  when already done, so re-running resumes after a failure.
- Host prerequisites are only git, Docker, and ddev, with one copy-pasteable
  remedy per missing tool; PHP/Composer/Drush/MySQL all run inside ddev.
- install.sh bootstrap installs the native acli release build (no PHP
  required on macOS arm64/Linux x86_64) with sha256 verification, then runs
  acli setup. CI now publishes .sha256 files with release assets.
- PullCommandBase::pullDatabase() now returns downloaded dump paths so
  callers can import them through ddev.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Live end-to-end testing caught two bugs:
- cloneFromCloud() ran the branch checkout before checking whether git
  clone succeeded, turning a failed clone into an unhelpful 'cwd does
  not exist' process error instead of the intended message.
- ddev import-db --file stages the dump through the .ddev bind mount,
  which fails on some Docker providers (e.g. colima); stream the dump
  through stdin instead.

Also recognize SSH keys that exist only in an SSH agent (e.g. the
1Password agent) when checking Cloud Platform key registration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A stack can come up with the site still broken (e.g. Docker providers
that fail to share the project path produce a fallback nginx config that
404s everything). Warn with next steps instead of claiming success.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The push credential for this fork lacks the workflow scope. The two-line
checksum change is carried in the PR description for someone with
workflow permissions to apply; install.sh already handles releases
without checksums gracefully.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Colons are invalid in NTFS filenames, so the fixture broke the Windows
CI job. The file is unnecessary: Filesystem::remove() is a no-op for
missing paths.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Instead of silently deriving the target directory, setup now asks where
to clone, prefilled with ./<sitegroup> so Enter accepts the default.
--dir and non-interactive runs skip the prompt as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 5, 2026 08:18
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.12698% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.23%. Comparing base (ba0d98a) to head (993a590).

Files with missing lines Patch % Lines
src/Command/Dev/DevInitCommand.php 82.70% 32 Missing ⚠️
src/Command/Dev/DevStackTrait.php 82.14% 5 Missing ⚠️
src/EventListener/ExceptionListener.php 33.33% 2 Missing ⚠️
src/Command/Dev/DevStopCommand.php 92.85% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2033      +/-   ##
============================================
- Coverage     92.49%   92.23%   -0.26%     
- Complexity     1995     2077      +82     
============================================
  Files           123      127       +4     
  Lines          7238     7487     +249     
============================================
+ Hits           6695     6906     +211     
- Misses          543      581      +38     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new top-level acli setup command that bootstraps a local Acquia application checkout into a working ddev-based dev environment, plus a small installer script and supporting plumbing so setup can clone and import reliably.

Changes:

  • Introduces setup command that authenticates, ensures an SSH key, clones code, configures/starts ddev, imports DB/files, and validates site responsiveness.
  • Adds an install.sh bootstrap flow and README “Quick start” snippet to install the latest release asset and launch acli setup.
  • Updates pull/clone internals to (a) return downloaded DB dump paths and (b) fail fast on clone errors before attempting checkout; adds contextual help messaging and tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/phpunit/src/Commands/App/SetupCommandTest.php Adds PHPUnit coverage for setup flows (prereqs/auth/ssh key/clone/ddev/import/resume).
tests/phpunit/src/Application/KernelTest.php Registers the new setup command in the CLI command list assertion.
src/EventListener/ExceptionListener.php Adds a targeted help hint for clone failures likely caused by SSH key propagation/registration.
src/Command/Pull/PullCommandBase.php Returns DB dump paths from pullDatabase() and improves clone error handling; makes clone method reusable by subclasses.
src/Command/App/SetupCommand.php Implements the new end-to-end local environment bootstrap command.
README.md Documents a one-command quick start via install.sh and acli setup.
install.sh Adds a portable installer that downloads release assets, verifies sha256 when available, installs acli, and runs acli setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install.sh
Comment on lines +89 to +90
say "Note: $INSTALL_DIR is not in your PATH. Add it with:"
say " echo 'export PATH=\"$INSTALL_DIR:\$PATH\"' >> ~/.$(basename "${SHELL:-bash}")rc"
Comment thread src/Command/App/SetupCommand.php Outdated
Comment on lines +367 to +375
try {
$status = $this->httpClient->request('GET', $url, [
'http_errors' => false,
'timeout' => 30,
'verify' => false,
])->getStatusCode();
} catch (Exception) {
$status = 0;
}
The next steps now explain that committing and pushing deploys, since
the cloned branch is what the chosen environment runs. Omitted for
tag-tracking environments, where a push does not deploy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…v:stop

setup becomes dev:init, and the daily start/stop loop gets thin acli
wrappers so newcomers stay in one vocabulary for the lifecycle moments.
dev:start re-prints the site URL and health-checks it; dev:stop shuts the
stack down. Everything else (drush, logs, ssh) intentionally stays with
ddev directly. The namespace is platform-neutral so future platforms
become a routing decision inside dev:init rather than a new prefix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

2 participants