Refactor: Reorganize storage configurations into dedicated module#131
Conversation
…Type to a new storage module. Update imports across the codebase to reflect this change, ensuring consistency in S3 bucket configurations and data source handling.
|
@claude please review this PR |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Claude finished @jfrench9's task in 1m 44s —— View job PR Review Complete ✅Todo List
SummaryThis refactoring successfully reorganizes storage configurations into a dedicated module with good separation of concerns. The changes are well-structured and improve code organization. I've identified a few areas for improvement below. Strengths
Issues & Recommendations🔴 Critical1. Inconsistent Import Usage in The backup service uses self.s3_prefix = f"graph-databases/{environment}"Recommendation: The backup service should use the new graph storage helpers: from robosystems.config.storage import graph
# In __init__:
self.s3_prefix = graph.get_instance_backup_prefix(environment).rstrip('/')
# In backup_graph_database:
s3_key = graph.get_instance_backup_key(self.environment, graph_id, start_time)This would eliminate hardcoded path construction and ensure consistency with the centralized configuration. 🟡 Minor2. Test Import Changes Missing Context (tests/operations/lbug/test_backup_service.py) The test file imports were updated from: from robosystems.config.shared_data import ...However, I don't see these imports being used in the test file. The test file appears to only import from 3. Removed Test Code Without Explanation (tests/integration/test_subgraph_operations.py) 25 lines were removed from the integration test file. While this is noted in the PR description, there's no explanation of what was removed or why. Looking at the remaining code, it appears to be setup/fixture code, but it would be helpful to document:
4. Missing The __all__ = [
"GraphStorageType",
"GraphStorageConfig",
"GRAPH_STORAGE",
"get_staging_key",
"get_staging_prefix",
"get_backup_key",
# ... etc
]💡 Suggestions5. Consider Adding Integration Tests The new graph storage helpers have excellent docstrings with examples, but I don't see dedicated tests for them. Consider adding tests to verify:
6. CLAUDE.md Update Needed The CLAUDE.md file mentions configuration modules but doesn't reference the new Architecture ReviewThe refactoring aligns well with the stated goals in CLAUDE.md:
The new structure provides:
Breaking ChangesThe PR correctly notes breaking changes for external imports. However, since this is an internal refactoring and all internal imports have been updated, the impact should be minimal. The old VerdictApprove with Recommendations This is a solid refactoring that improves code organization. The critical issue (#1) should be addressed to ensure the backup service uses the new centralized path construction helpers. The minor issues are nice-to-haves that would further improve the quality. Recommendation: Address issue #1 (backup service should use graph storage helpers) before merging. The other issues can be addressed in follow-up work if preferred. Files Reviewed
|
…s for S3 backup operations. Updated S3 prefix and key generation methods to improve consistency and maintainability in backup processes.
Summary
This PR refactors the storage configuration management by creating a dedicated
storagemodule and reorganizing shared data components. The primary goal is to improve code organization and maintainability of storage-related configurations across the system.Key Changes
robosystems/config/storage/package with proper module structureDATA_SOURCESandDataSourceTypedefinitions to the new storage modulestorage/graph.pyshared_data.pytostorage/shared.pyfor better organizationAccomplishments
Breaking Changes
robosystems.config.shared_datawill need to update imports to use the newrobosystems.config.storagemodule structure.Testing Notes
Infrastructure Considerations
This refactoring improves the system's configuration management architecture by:
🤖 Generated with Claude Code
Branch Info:
refactor/storage-configsmainCo-Authored-By: Claude noreply@anthropic.com