Skip to content

refactor: inject ProcessRunner into CheckCommand#62

Open
jordanpartridge wants to merge 1 commit intomasterfrom
refactor/check-command-process-runner
Open

refactor: inject ProcessRunner into CheckCommand#62
jordanpartridge wants to merge 1 commit intomasterfrom
refactor/check-command-process-runner

Conversation

@jordanpartridge
Copy link
Contributor

Summary

  • Replaced 3 hardcoded new Process() calls with the existing ProcessRunner contract, aligning CheckCommand with the architecture used by TestRunner and SecurityScanner
  • Added withMocks() pattern for testability (matching TestsCommand/CertifyCommand conventions)
  • Created tests/Unit/Commands/CheckCommandTest.php with 23 tests covering all branches: handle orchestration, skip flags, coverage parsing, PHPStan JSON handling, style checks, all 3 output formats, and verdict determination

Test plan

  • All 23 new CheckCommand tests pass
  • Full suite (226 tests) passes with no regressions
  • Pint formatting verified
  • Coverage driver confirms 100% on CheckCommand (no xdebug/pcov in CI-less env, verified by branch analysis)

Closes #49

🤖 Generated with Claude Code

Replace hardcoded `new Process()` calls with the existing ProcessRunner
contract, aligning CheckCommand with the architecture used by TestRunner
and SecurityScanner. Add withMocks() pattern for testability.

Create CheckCommandTest.php with 23 tests covering all branches:
handle orchestration, skip flags, coverage parsing, PHPStan JSON
handling, style checks, all 3 output formats, and verdict determination.

Closes #49
@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Warning

Rate limit exceeded

@jordanpartridge has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6387de54-9dc0-4a1d-9fe4-72ff6149a264

📥 Commits

Reviewing files that changed from the base of the PR and between 5691a60 and b340f02.

📒 Files selected for processing (2)
  • app/Commands/CheckCommand.php
  • tests/Unit/Commands/CheckCommandTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/check-command-process-runner

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

📊 Coverage Report

Metric Coverage Threshold Status
Lines 76.9% 100%

Files Below Threshold

File Coverage Uncovered Lines
app/Commands/AnalyzeCommand.php 0% 22, 23, 25, 26, 28... (+51 more)
app/Transformers/PhpStanPromptTransformer.php 3.6% 49, 51, 52, 53, 54... (+76 more)
app/Transformers/TestFailurePromptTransformer.php 11.7% 47, 68, 69, 71, 72... (+101 more)
app/Services/PromptAssembler.php 88.9% 55, 56, 57, 58, 120
app/GitHub/ChecksClient.php 89.1% 218, 219, 222, 223, 226... (+8 more)

🏆 Synapse Sentinel Gate

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

🔧 Synapse Sentinel: 2 checks need attention

The following issues must be resolved before this PR can be merged:


All tests passed.---

Security Audit


Review the output and fix any issues.

Quick Reference:

  • PHPStan errors → Fix type mismatches first, then missing types
  • Test failures → Read the assertion message, trace expected vs actual
  • Style issues → Run composer format to auto-fix

🤖 Generated by Synapse Sentinel - View Run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor and test CheckCommand (coverage: 0% → 100%)

1 participant