Skip to content

Conversation

@kalindi-adhiya
Copy link
Contributor

Motivation

Fixes #NNN

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)

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.28%. Comparing base (5b44af7) to head (77a4588).

Files with missing lines Patch % Lines
src/Command/Pull/PullCommandBase.php 94.11% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1958      +/-   ##
============================================
- Coverage     92.28%   92.28%   -0.01%     
- Complexity     1910     1918       +8     
============================================
  Files           122      122              
  Lines          6987     7008      +21     
============================================
+ Hits           6448     6467      +19     
- Misses          539      541       +2     

☔ 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

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

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

@kalindi-adhiya kalindi-adhiya marked this pull request as ready for review January 30, 2026 05:12
Copy link
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 adds validation for database backup downloads to ensure files are valid before attempting to import them. The changes detect common failure scenarios (empty files, invalid gzip content, HTTP errors, missing files) and provide clear error messages.

Changes:

  • Added validation methods to check HTTP response status, file existence, file size, and gzip format validity
  • Updated test infrastructure to support validation error scenarios across Windows and non-Windows platforms
  • Added comprehensive test coverage for empty files, invalid gzip content, missing files, small files, and HTTP errors

Reviewed changes

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

File Description
src/Command/Pull/PullCommandBase.php Implements validation logic for backup downloads including HTTP response validation and gzip file format verification
tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php Adds test cases for various validation error scenarios and getter/setter tests for backup download URL
tests/phpunit/src/Commands/Pull/PullCommandTestBase.php Updates mock infrastructure to support validation testing and handle Windows-specific filename generation

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

$dbMachineName,
$backupResponse->completedAt,
]) . '.sql.gz';
if (PHP_OS_FAMILY === 'Windows') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why change this? I don't see anything in the parent ticket mentioning Windows compatibility

Copy link
Contributor Author

@kalindi-adhiya kalindi-adhiya Feb 10, 2026

Choose a reason for hiding this comment

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

@danepowell it was due to failing testcases specifically for windows

Copy link

Choose a reason for hiding this comment

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

I don't think that was meant for me, but I'm glad you found the problem!

Copy link
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 3 out of 3 changed files in this pull request and generated 6 comments.


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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants