Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI-1435: PHP error - undefined array key handled in pull command #1844

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rahulgupta-acquia
Copy link
Contributor

Motivation

Fixes CLI-1435

Proposed changes

Alternatives considered

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)

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.90%. Comparing base (304cc82) to head (883b5bf).

Files with missing lines Patch % Lines
src/Command/CommandBase.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1844      +/-   ##
============================================
- Coverage     92.92%   92.90%   -0.02%     
- Complexity     1846     1847       +1     
============================================
  Files           123      123              
  Lines          6964     6966       +2     
============================================
+ Hits           6471     6472       +1     
- Misses          493      494       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

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

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

@@ -1517,6 +1517,10 @@ private function promptChooseAcsfSite(EnvironmentResponse $cloudEnvironment): mi
foreach ($acsfSites['sites'] as $domain => $acsfSite) {
$choices[] = "{$acsfSite['name']} ($domain)";
}
if (!count($choices)) {
throw new AcquiaCliException("Could not get ACSF sites");
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to add a test case to cover this line. I'd suggest copying testRefreshAcsfFiles from PullFilesCommandTest.php and modify it to expect this exception. You'll need to modify mockGetAcsfSites() to return 0 sites to trigger the exception.

@rahulgupta-acquia rahulgupta-acquia added the bug Something isn't working label Jan 22, 2025
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