Add external database directory support for network file systems#402
Open
felipecaldas wants to merge 1 commit intotirth8205:mainfrom
Open
Add external database directory support for network file systems#402felipecaldas wants to merge 1 commit intotirth8205:mainfrom
felipecaldas wants to merge 1 commit intotirth8205:mainfrom
Conversation
Fixes SQLite WAL mode failures on Samba/CIFS shares by allowing users to store the graph database in an external local directory while keeping source code on network shares. Problem: - SQLite's WAL mode requires filesystem features not fully supported by network file systems - Building graph on Samba/NFS shares fails with 'database is locked' error at PRAGMA journal_mode=WAL - Developers using network shares cannot use code-review-graph Solution: - Add --data-dir CLI flag to store database in external location - Extend multi-repo registry to remember per-repo data_dir configuration - Implement resolution priority: registry > CRG_DATA_DIR env var > default .code-review-graph/ - All CLI commands and MCP tools automatically use the external location Changes: - code_review_graph/registry.py: Add set_data_dir() and get_data_dir_for_repo() methods - code_review_graph/incremental.py: Modify get_data_dir() to check registry first - code_review_graph/cli.py: Add --data-dir argument to build, update, status, watch, visualize, wiki, postprocess - code_review_graph/tools/registry_tools.py: Fix cross_repo_search to use get_db_path() for custom locations - tests/test_registry.py: Add TestSetDataDir class with 5 tests - tests/test_incremental.py: Add TestDataDirRegistry class with 5 tests Benefits: - Eliminates database lock errors on network file systems - Better performance (local disk vs network I/O) - Clean separation of source code and index data - Persistent configuration via registry - 100% backward compatible - All 28 MCP tools work automatically with custom data_dir Usage: cd /mnt/repos/my-project code-review-graph build --data-dir ~/.crg-graphs/my-project Testing: - All 83 tests pass (registry + incremental) - Manual testing successful on test project - Cross-repo search verified with custom data_dir - MCP server integration confirmed
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.
Fixes SQLite WAL mode failures on Samba/CIFS shares by allowing users to store the graph database in an external local directory while keeping source code on network shares.
Problem:
Solution:
Changes:
Benefits:
Usage:
cd /mnt/repos/my-project code-review-graph build --data-dir ~/.crg-graphs/my-project
Testing: