CLI-1711: [NCI] Database and File commands support#1961
CLI-1711: [NCI] Database and File commands support#1961jigar-shah-acquia merged 45 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements support for NCI (non-customer-interfacing) database, file, and environment commands in ACLI, enabling internal workflows for managing site instances. The changes remove previously added non-standard API specifications from version control and instead load them from GitHub Actions secrets during the build process.
Changes:
- Remove deprecated
mungeResponse()method and translation endpoint handling logic - Delete non-
cx-api-specOpenAPI definitions for translation endpoints fromacquia-spec.json - Add GitHub Actions workflow steps to merge additional API specs from secrets into the base specification file
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/phpunit/src/Commands/Api/ApiCommandTest.php | Removes test for translation response munging that stripped _links fields |
| src/Command/Api/ApiBaseCommand.php | Removes translation path detection and response munging logic from command execution |
| assets/acquia-spec.json | Removes OpenAPI definitions for deprecated translation endpoints (log-list, log-download, code-switch) |
| .github/workflows/ci.yml | Adds workflow steps to extract and merge additional API specs from GitHub secrets during build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Try the dev build for this PR: https://acquia-cli.s3.amazonaws.com/build/pr/1961/acli.phar |
anujkaushal
left a comment
There was a problem hiding this comment.
LGTM.
➜ acli_dump ./acli.phar api:environments-v3:log-create --from "2026-02-02T00:00:00.000Z" --to "2026-02-02T10:00:00.000Z" RETRACTED cronjob
{
"message": "The log file is being created.",
"_links": {
"self": {
"href": "https:\/\/staging.cloud.acquia.com\/api\/environments\/RETRACTED\/logs\/cronjob"
},
"parent": {
"href": "https:\/\/staging.cloud.acquia.com\/api\/environments\/RETRACTED\/logs"
},
"notification": {
"href": "https:\/\/staging.cloud.acquia.com\/api\/notifications\/RETRACTED"
}
}
}
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1961 +/- ##
=========================================
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:
|
| } | ||
|
|
||
| if (substr($this->path, 0, 12) === '/translation') { | ||
| $this->mungeResponse($response); |
There was a problem hiding this comment.
Isn't this going to result in the embedded links appearing in translation API responses again? @shriacquia is this what you intended? Seems like this is going to cause enormous confusion for the customer and concern for Alan and team.
I wish I'd had a chance to re-review this PR after requesting changes on it.
There was a problem hiding this comment.
Links should not be sent to the client as mentioned also in the implementation details that I had to put in.
There was a problem hiding this comment.
I have implemented this change and created the corresponding ticket and PR for it.
https://acquia.atlassian.net/browse/CLI-1729
#1962
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.