fix(data-layer): DL-25 followup - Add story validation test - #100
Closed
spuentesp wants to merge 2 commits into
Closed
fix(data-layer): DL-25 followup - Add story validation test#100spuentesp wants to merge 2 commits into
spuentesp wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR contains follow-up fixes to DL-25, addressing Neo4j API usage and adding missing test coverage for story validation during combat creation.
Key Changes:
- Refactored Neo4j story validation to use the proper
execute_read()API instead of raw session access - Added test coverage for the story validation error path in combat creation
- Updated test mocks to align with the corrected implementation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/data-layer/src/monitor_data/tools/mongodb_tools.py |
Updated mongodb_create_combat to use neo4j_client.execute_read() instead of raw session API, consistent with other Neo4j operations in the codebase |
packages/data-layer/tests/test_tools/test_combat_tools.py |
Simplified test mocking for test_create_combat_success by removing unnecessary intermediate mock objects, and added test_create_combat_story_not_found to verify proper error handling when story doesn't exist |
Summary: The changes are well-implemented and properly tested. The refactored Neo4j API usage follows established patterns elsewhere in the codebase (e.g., mongodb_create_story_outline), and the new test appropriately covers the story validation error path. No issues were identified during review.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Follow-up fixes to DL-25 after initial merge:
Fix combat creation Neo4j validation (d1c36cb)
mongodb_create_combatto useneo4j_client.execute_read()instead of raw session accessAdd combat story validation test (8caf6e3)
test_create_combat_story_not_foundto verify error handling when story doesn't existThese commits were added to the feature branch after PR #99 was merged.
Testing
All tests passing ✅
🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com