feat: add StructureException handling for invalid datetime values in …#854
feat: add StructureException handling for invalid datetime values in …#854
Conversation
…Mongo adapter and corresponding tests
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe MongoDB adapter now wraps DateTime conversion failures in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR wraps Confidence Score: 3/5The adapter change is safe to merge on its own, but the test provides no evidence that the new The try/catch in tests/e2e/Adapter/Scopes/DocumentTests.php — test does not reach the new Mongo Important Files Changed
Reviews (2): Last reviewed commit: "updated tests" | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/Adapter/Scopes/DocumentTests.php`:
- Line 5826: The test builds $id as "$createdAt-{$index}" which can produce ids
starting with '$' and trigger a StructureException before the intended datetime
validation for $createdAt/$updatedAt; change the id generation (the $id variable
where '$id' => $attribute . '-' . $index is set) to produce a valid id that
cannot start with '$' (e.g., prefix with a neutral string or use the index only)
so the datetime path is exercised, and update the failing assertion to also
check the thrown StructureException message contains the target attribute name
($createdAt or $updatedAt) to ensure the failure source is the datetime
validation rather than an invalid id.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cb62c484-0d61-4ac7-9dd8-6eac75e22055
📒 Files selected for processing (2)
src/Database/Adapter/Mongo.phptests/e2e/Adapter/Scopes/DocumentTests.php
…Mongo adapter and corresponding tests
Summary by CodeRabbit
Bug Fixes
Tests