Skip to content

IDE-4864: acli pull db db connector changes#1985

Open
kalindi-adhiya wants to merge 8 commits intoacquia:mainfrom
kalindi-adhiya:IDE-4864
Open

IDE-4864: acli pull db db connector changes#1985
kalindi-adhiya wants to merge 8 commits intoacquia:mainfrom
kalindi-adhiya:IDE-4864

Conversation

@kalindi-adhiya
Copy link
Copy Markdown
Contributor

@kalindi-adhiya kalindi-adhiya commented Apr 20, 2026

Motivation

Fixes acli pull:db for ide meo

Proposed changes

Now there is 2 separate api calls required to have db information , implemented that change

testing on Ide

Kalindi_test_2204:~/project $ ACLI_CLOUD_API_BASE_URI=https://staging.cloud.acquia.com/api ACLI_CLOUD_API_ACCOUNTS_URI=https://staging.accounts.acquia.com/api/auth/oauth/token /home/ide/acli.phar pull:db
Detected Codebase UUID: 1163d796-8f2b-4305-8c15-85802ec8ee48
Using codebase: devxpipe10nov

 Choose a site instance [devxtest6jan]:
  [0] devxtest6jan
  [1] apr9meotesting
  [2] devxtest3apr
 > 0

                                                                                                                        
 [INFO] Using a database backup that is 2 hours old. Backup #9361783 was created at Wed Apr 22 6:59:05 UTC 2026.        
                                                                                                                        
        You can view your backups here: https://cloud.acquia.com/a/environments/cbffc507-a720-40b3-9545-c0e2cb46d281/databases
                                                                                                                        
        To generate a new backup, re-run this command with the --on-demand option.                                      
                                                                                                                        

    ✔ Downloading 37553b5ccc2e4b29b7995bcc9e464d33 database copy from the Cloud Platform
    ⌛ Importing 37553b5ccc2e4b29b7995bcc9e464d33 database download...
 
 ! [NOTE] Cloud IDE only supports importing into the default Drupal database. Acquia CLI will import the NON-DEFAULT    
    ✔ Importing 37553b5ccc2e4b29b7995bcc9e464d33 database download

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)

Copilot AI review requested due to automatic review settings April 20, 2026 11:19
@kalindi-adhiya kalindi-adhiya changed the title IDE_4864: acli pull db db connector changes IDE-4864: acli pull db db connector changes Apr 20, 2026
@kalindi-adhiya kalindi-adhiya added the bug Something isn't working label Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates IDE/ACLI site-instance database handling to fetch connection details via the updated Acquia Cloud API SDK, ensuring database pulls use the correct host/user/password (and ssh host) source.

Changes:

  • Bump typhonius/acquia-php-sdk-v2 to ^3.8.0.
  • Update EnvironmentTransformer::transformSiteInstanceDatabase() to take both database metadata and database connection details.
  • Update CommandBase::determineCloudDatabases() to fetch and use the new site-instance database connection details.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/Transformer/EnvironmentTransformer.php Switches site-instance DB transformation to use a dedicated connection response for credentials/hosts.
src/Command/CommandBase.php Fetches site-instance DB connection details and passes them into the updated transformer.
composer.json Bumps Acquia Cloud API SDK dependency to ^3.8.0.
composer.lock Locks updated SDK version and associated metadata.

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

Comment thread composer.json
Comment thread src/Transformer/EnvironmentTransformer.php Outdated
Comment thread src/Transformer/EnvironmentTransformer.php
Comment thread src/Command/CommandBase.php Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.40%. Comparing base (c864c3f) to head (9d168cb).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1985      +/-   ##
============================================
+ Coverage     92.35%   92.40%   +0.05%     
- Complexity     1953     1956       +3     
============================================
  Files           123      123              
  Lines          7168     7178      +10     
============================================
+ Hits           6620     6633      +13     
+ Misses          548      545       -3     

☔ View full report in Codecov by Sentry.
📢 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
Copy link
Copy Markdown

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

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

Comment thread tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php Outdated
Comment thread src/Command/CommandBase.php Outdated
Copy link
Copy Markdown

@deepakmishra2 deepakmishra2 left a comment

Choose a reason for hiding this comment

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

Solid work with good test coverage. The short-circuit optimization is worth addressing before merge — it avoids an unnecessary network call on the failure path.

@kalindi-adhiya kalindi-adhiya marked this pull request as draft April 20, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread src/Transformer/EnvironmentTransformer.php Outdated
Comment thread src/Command/CommandBase.php Outdated
Comment thread tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php
Comment thread tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php
@kalindi-adhiya kalindi-adhiya marked this pull request as ready for review April 22, 2026 05:37
Copy link
Copy Markdown

@deepakmishra2 deepakmishra2 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants