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)

@kalindi-adhiya kalindi-adhiya added the bug Something isn't working label Jan 8, 2026
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.31%. Comparing base (be29def) to head (b89a840).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1952      +/-   ##
============================================
+ Coverage     92.05%   92.31%   +0.26%     
- Complexity     1894     1895       +1     
============================================
  Files           122      122              
  Lines          6959     6961       +2     
============================================
+ Hits           6406     6426      +20     
+ Misses          553      535      -18     

☔ 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

github-actions bot commented Jan 8, 2026

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

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

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 fixes a null pointer exception (CLI-1671) by adding a null check before attempting to assign a property to a potentially null site instance object. The fix prevents the error "Attempt to assign property 'site' on null" by throwing an appropriate exception when getSiteInstance() returns null.

Key Changes:

  • Added null check for site instance in determineSiteInstance() method before property assignment
  • Added comprehensive test coverage for the null check scenario
  • Added tests for visibility and successful path scenarios

Reviewed changes

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

File Description
src/Command/CommandBase.php Added null check (lines 885-887) to prevent assignment to null object
tests/phpunit/src/Commands/CommandBaseTest.php Added 5 new tests covering the null check fix, successful path, and method visibility
tests/phpunit/src/Commands/Api/ApiCommandTest.php Added 3 tests for API command help text (appears unrelated to main fix)

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

Copy link
Contributor

@danepowell danepowell left a comment

Choose a reason for hiding this comment

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

Code looks good, but why do we need 300 lines of test cases for a three-line code change? I would expect to see just a single new test case.

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 2 out of 2 changed files in this pull request and generated no new 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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants