This fixes issue #5389 where PRs were getting stuck with pending status when
ATLANTIS_SILENCE_VCS_STATUS_NO_PLANS and ATLANTIS_SILENCE_VCS_STATUS_NO_PROJECTS
were enabled and no projects matched when_modified patterns.
Root cause:
- PR #5242 (commit be060636) introduced early pending status setting in command_runner.go
- When silence flags are enabled and no projects are found, the pending status was never cleared
- This left PRs stuck in pending state, blocking auto-merge functionality
Solution:
- Modified plan_command_runner.go to clear pending status even when silence flags are enabled
- Added else blocks to both autoplan and manual plan paths
- When silence is enabled but no projects found, update status to success (0/0) to clear pending
- Added comprehensive test to prevent regression
Testing:
- Updated existing test expectation for silence flag behavior
- Added new test TestPlanCommandRunner_SilenceFlagsClearsPendingStatus
- All existing tests continue to pass