CLI-1711: [NCI] Database and File commands support#1959
CLI-1711: [NCI] Database and File commands support#1959jigar-shah-acquia wants to merge 44 commits intoacquia:mainfrom
Conversation
|
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1959/acli.phar |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1959 +/- ##
=========================================
Coverage 92.28% 92.28%
+ Complexity 1916 1910 -6
=========================================
Files 122 122
Lines 6995 6987 -8
=========================================
- Hits 6455 6448 -7
+ Misses 540 539 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for NCI database, file, and environment commands in ACLI by implementing a system to merge additional API specs from environment variables or GitHub Actions secrets. The changes enable internal workflows for managing site instances without exposing unstable APIs directly to customers.
Changes:
- Implemented API spec merging logic to combine additional specs from environment variables with base specs
- Removed previously hardcoded non-standard API endpoints from
acquia-spec.json - Updated
_linksremoval to apply to all API responses instead of only translation endpoints - Modified CI workflow to extract additional API specs from GitHub Actions secrets
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Command/Api/ApiCommandHelper.php | Added mergeAdditionalSpecs() method to load and merge additional API specs from environment variables |
| src/Command/Api/ApiBaseCommand.php | Updated mungeResponse() to recursively remove _links from all API responses |
| assets/acquia-spec.json | Removed hardcoded NCI endpoints that are now loaded via additional specs |
| assets/acquia-spec.version | Updated spec version reference |
| tests/phpunit/src/Commands/Api/ApiCommandTest.php | Added comprehensive test coverage for spec merging and _links removal |
| tests/phpunit/src/Misc/ExceptionListenerTest.php | Removed test assertion for log-create help message |
| src/EventListener/ExceptionListener.php | Removed special handling for log-download error message |
| .github/workflows/ci.yml | Added step to extract additional API specs from GitHub Actions secrets |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Motivation
This change adds support for NCI database, file, and environment commands in ACLI. These commands enable internal workflows for managing site instances, including database backups, database and file copy operations, environment log creation, and Varnish cache clearing, without exposing raw API endpoints directly to customers.
This work also cleans up previous non-standard API spec handling and aligns ACLI with service-owned and
cx-api-specdefinitions.Fixes CLI-1711
Proposed Changes
cx-api-specadditions previously committed toacquia-spec.json(from PR CLI-1696: MEO commands #1955)._linksfrom API responses to align with expected CLI output.post-log-openapi.json) for environment log creation.Alternatives Considered
cx-api-specwas preferred for stability and consistency where available.Testing Steps
acli.phar.