Skip to content

IDE-5067: CLI push and pull db command failing on code studio and IDE.#1999

Open
deepakmishra2 wants to merge 1 commit into
mainfrom
IDE-5067
Open

IDE-5067: CLI push and pull db command failing on code studio and IDE.#1999
deepakmishra2 wants to merge 1 commit into
mainfrom
IDE-5067

Conversation

@deepakmishra2
Copy link
Copy Markdown
Contributor

Motivation

Fixes #IDE-5067

Copilot AI review requested due to automatic review settings May 26, 2026 12:23
@deepakmishra2 deepakmishra2 added the bug Something isn't working label May 26, 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

This PR addresses database push/pull failures in Code Studio/IDE (MEO/codebase-UUID context) by improving environment/database handling and adding an execution flag to skip Drupal cache clearing when needed.

Changes:

  • Add MEO-aware environment normalization in telemetry.
  • Make push:db more resilient to MEO database responses (null DB URL) and missing environment SSH URL (via fallback).
  • Add pull:db --no-cache-clear to skip drush cache:rebuild while still allowing other post-import steps.

Reviewed changes

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

Show a summary per file
File Description
src/Helpers/TelemetryHelper.php Adds MEO normalization branch for AH environment telemetry.
src/Command/Push/PushDatabaseCommand.php Adds SSH URL fallback logic and supports DB name derivation when DatabaseResponse::url is null (MEO).
src/Command/Pull/PullDatabaseCommand.php Introduces --no-cache-clear option and gates cache rebuild accordingly.
src/Command/CommandBase.php Populates siteId for codebase/MEO context to enable SiteInstance DB API usage.
tests/phpunit/src/Misc/TelemetryHelperTest.php Adds test coverage for MEO telemetry normalization.
tests/phpunit/src/Commands/Push/PushDatabaseCommandTest.php Adds test coverage for pushing a DB when DatabaseResponse::url is null (MEO-style response).
tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php Adds test coverage for --no-cache-clear behavior.

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

}

/**
* Test normalizeAhEnv() returns 'meo' when AH_CODEBASE_UUID is set.
$siteInstanceId = $this->determineSiteInstanceFromCodebaseUuid($chosenEnvironment, $input, $output);
if ($siteInstanceId) {
[$siteId] = explode('.', $siteInstanceId);
$this->siteId = $siteId;
Comment on lines +80 to +89
private function determineSshUrl(EnvironmentResponse $environment, DatabaseResponse $database): string
{
if (!empty($environment->sshUrl)) {
return $environment->sshUrl;
}
if (!empty($database->ssh_host)) {
return $environment->name . '@' . $database->ssh_host;
}
throw new AcquiaCliException('Cannot determine environment SSH URL. Check that you have SSH permissions on this environment.');
}
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.

2 participants