Add acli setup: one command from nothing to a local dev environment - #2033
Add acli setup: one command from nothing to a local dev environment#2033lauriii wants to merge 8 commits into
Conversation
- 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>
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
|
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/2033/acli.phar |
There was a problem hiding this comment.
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
setupcommand that authenticates, ensures an SSH key, clones code, configures/starts ddev, imports DB/files, and validates site responsiveness. - Adds an
install.shbootstrap flow and README “Quick start” snippet to install the latest release asset and launchacli 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.
| say "Note: $INSTALL_DIR is not in your PATH. Add it with:" | ||
| say " echo 'export PATH=\"$INSTALL_DIR:\$PATH\"' >> ~/.$(basename "${SHELL:-bash}")rc" |
| 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>
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.
remedy per missing tool; PHP/Composer/Drush/MySQL all run inside ddev.
required on macOS arm64/Linux x86_64) with sha256 verification, then runs
acli setup. CI now publishes .sha256 files with release assets.
callers can import them through ddev.
Co-Authored-By: Claude Fable 5 noreply@anthropic.comMotivation
Fixes #NNN
Proposed changes
Alternatives considered
Testing steps
./bin/acli ckc