Skip to content

fix: add postActionablePrompt tests and logError type safety#58

Open
jordanpartridge wants to merge 1 commit intomasterfrom
fix/checksclient-coverage-100
Open

fix: add postActionablePrompt tests and logError type safety#58
jordanpartridge wants to merge 1 commit intomasterfrom
fix/checksclient-coverage-100

Conversation

@jordanpartridge
Copy link
Contributor

Summary

  • Add 7 tests for postActionablePrompt() covering all code paths (not available, no PR number, empty prompt, success, API error, 403, 429)
  • Fix logError() type safety: add instanceof RequestException check before calling hasResponse(), which only exists on RequestException, not on the GuzzleException interface
  • Run Pint to fix code style across touched files

Coverage

ChecksClient coverage: 89.1% → 100%

Test plan

  • All 34 ChecksClient tests pass
  • pest --filter=ChecksClient --coverage shows 100% for ChecksClient
  • Pint passes with no remaining issues

Closes #46

Add 7 tests for postActionablePrompt() covering all paths: not available,
no PR number, empty prompt, success, API error, 403, and 429 responses.

Fix logError() type safety by adding instanceof RequestException check
before calling hasResponse(), which only exists on RequestException,
not on the GuzzleException interface.

ChecksClient coverage: 89.1% → 100%
@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 20 minutes and 8 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: 09d1a84e-a360-4323-8468-f530b21fedac

📥 Commits

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

📒 Files selected for processing (6)
  • app/Commands/CertifyCommand.php
  • app/GitHub/ChecksClient.php
  • app/Services/PromptAssembler.php
  • app/Transformers/PhpStanPromptTransformer.php
  • app/Transformers/TestFailurePromptTransformer.php
  • tests/Unit/GitHub/ChecksClientTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/checksclient-coverage-100

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 69.4% 100%

Files Below Threshold

File Coverage Uncovered Lines
app/Commands/AnalyzeCommand.php 0% 22, 23, 25, 26, 28... (+51 more)
app/Commands/CheckCommand.php 0% 30, 31, 33, 34, 37... (+91 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

🏆 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.

Write ChecksClient.postActionablePrompt() tests (coverage: 89.1% → 100%)

1 participant