Repository navigation
test(coverage): 100% line coverage of src/, enforced in CI - #28
Merged
Merged
Conversation
…gate A trace frame lacking the function key raised an undefined array key error and the endpoint answered 500 instead of prompting the agent.
fread() with a zero length throws a ValueError, so an empty file in storage/logs made the whole page answer 500. Read the tail with file_get_contents() and an offset instead.
Application::handle() clones the sub-request, so $subRequest->route() was always null and trigger/replay profiles stored no route data. The MCP profile-url tool matched the route after the fact, which threw for unknown URLs and turned a 404 into a recorded 500. Read the route from the bound request instead.
Add laravel/ai to require-dev and test the agents and source-file tools with its fakes and Http::fake(); laravel/ai needs laravel/mcp ^1.0, so the dev constraint moves up and src/Ai is no longer excluded from PHPStan. DigDeep::$aiSdkAvailable lets tests simulate a missing SDK. Unreachable code is removed rather than ignored: empty-input guards in the percentile helpers, the session try/catch, the stats null check and a few always-true conditions. The coverage job now runs with --min=100.
|
Caution Review failedThe pull request is closed.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #22
What
src/. CI's coverage job now runspest --coverage --min=100. No@codeCoverageIgnore.laravel/ai ^1.3added torequire-dev, so the agents, tools and AI endpoints are tested withAgent::fake()andHttp::fake()(no real provider calls).laravel/mcpdev constraint moved to^1.0because laravel/ai needs it.src/Aiis no longer excluded from Larastan, and 5 stale baseline entries are gone.DigDeep::$aiSdkAvailable: a small test seam so the "laravel/ai missing → 501" path stays tested.Bugs found and fixed
trigger/replayand the MCPprofile-urltool read the route from the cloned sub-request, so it was always null. Unknown URLs were stored as 500 instead of 404.fread()with length 0).ai-investigatereturned 500 when a trace frame had nofunctionkey./digdeep/, so apps living in such a path reported every caller asunknown. It now skips only the package's ownsrc/.Removed as unreachable
Empty-input guards in the percentile helpers, the session try/catch behind
hasSession(), thestats()no-row branch, an object branch inInertiaCollector(props come fromjson_decodeas arrays), a try/catch around a non-throwingjson_encode, and a null fallback on a non-nullable command name.Checks
lint, analyse and gitleaks clean.