-
Notifications
You must be signed in to change notification settings - Fork 1
Claude/refactor directory structure 011 c us sd tp bi mf1 eiq b hx zr m #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Claude/refactor directory structure 011 c us sd tp bi mf1 eiq b hx zr m #21
Conversation
Major restructuring to align with Python best practices: ## Changes ### 1. New Package Structure - Created `src/codebase_rag/` as main package directory - All application code now under `src/` (PyPA standard) - Moved `__version__.py` to `src/codebase_rag/` ### 2. Configuration Module - Moved `config.py` → `src/codebase_rag/config/settings.py` - Split validation functions → `src/codebase_rag/config/validation.py` - Added backward compatibility shim with deprecation warning ### 3. Services Reorganization - Reorganized services into logical subpackages: - `services/knowledge/` - Neo4j knowledge services - `services/memory/` - Memory store and extraction - `services/code/` - Code analysis and ingestion - `services/sql/` - SQL parsing - `services/tasks/` - Task queue and processing - `services/utils/` - Utilities (git, ranker, metrics) - `services/pipeline/` - Data pipeline - `services/graph/` - Graph schema ### 4. MCP Package Restructuring - Renamed `mcp_tools/` → `src/codebase_rag/mcp/` - Moved `mcp_server.py` → `src/codebase_rag/mcp/server.py` - Organized handlers into `mcp/handlers/` subpackage - Renamed `tool_definitions.py` → `tools.py` ### 5. Entry Points Consolidation - Created `src/codebase_rag/server/` package: - `web.py` - Web server entry point - `mcp.py` - MCP server entry point - `cli.py` - CLI utilities - Updated `start.py` and `start_mcp.py` as thin wrappers - Enhanced `__main__.py` for `python -m codebase_rag` ### 6. Core and API Modules - Moved `core/` → `src/codebase_rag/core/` - Moved `api/` → `src/codebase_rag/api/` ### 7. Docker and CI/CD Updates - Updated all Dockerfiles to use new `src/` structure: - `Dockerfile` - `docker/Dockerfile.minimal` - `docker/Dockerfile.standard` - `docker/Dockerfile.full` - Updated GitHub workflows: - Fixed version path in `docker-build.yml` ## Benefits - Cleaner root directory - Clear package boundaries - Standard Python project structure - Better imports organization - Backward compatibility maintained ## Breaking Changes - Direct imports from old locations deprecated (warnings added) - Docker builds require updated COPY commands (already done) Refs: #related-to-restructure-plan
Phase 6: Non-code file organization and cleanup ## Changes ### Scripts Organization - Moved `build-frontend.sh` → `scripts/build-frontend.sh` - Moved `docker-start.sh` → `scripts/docker-start.sh` - Moved `docker-stop.sh` → `scripts/docker-stop.sh` - Created `scripts/README.md` documenting all scripts ### Cleanup - Removed all backup files: - Dockerfile.backup - config.py.backup - start.py.backup - start_mcp.py.backup - docker/Dockerfile.*.backup ### Verification - ✅ No empty directories found - ✅ AI config files (CLAUDE.md, GEMINI.md) properly ignored - ✅ All scripts now in unified location ## Benefits - Cleaner root directory (3 fewer shell scripts) - Centralized script management - Documented script usage and workflows - Removed temporary backup files Refs: #phase-6-cleanup
Scripts documentation should be in docs/development/ instead of a separate README in the scripts directory. Script usage is already documented in: - docs/development/setup.md - Individual script headers - Makefile help text
…layout Complete removal of backward compatibility shims and legacy code structure. ## Deleted Files and Directories ### Old Entry Scripts (all removed) - start.py - start_mcp.py - main.py - config.py (backward compat shim) - mcp_server.py ### Old Code Directories (duplicates removed) - api/ → now only in src/codebase_rag/api/ - core/ → now only in src/codebase_rag/core/ - services/ → now only in src/codebase_rag/services/ - mcp_tools/ → now only in src/codebase_rag/mcp/ - config/ → moved to examples/configs/ ## Updated Files ### pyproject.toml - Added proper console_scripts entry points: - codebase-rag (main CLI) - codebase-rag-web (web server) - codebase-rag-mcp (MCP server) - Updated [tool.setuptools] to use src-layout package discovery - Updated [tool.coverage.run] source paths ### All Dockerfiles - Removed COPY of old entry scripts - Updated CMD to use: python -m codebase_rag - Simplified COPY to just: COPY src ./src ### Import Fixes (20 files updated) - All imports updated from old paths to new src.codebase_rag paths - Fixed in: api/, core/, services/, mcp/, server/ ## New Standard Usage ### Command Line ```bash # Direct module invocation python -m codebase_rag # Start both services python -m codebase_rag --web # Web only python -m codebase_rag --mcp # MCP only python -m codebase_rag --version # After pip install (console_scripts) codebase-rag # Main CLI codebase-rag-web # Web server codebase-rag-mcp # MCP server ``` ### Docker ```dockerfile CMD ["python", "-m", "codebase_rag"] ``` ## Benefits - ✅ 100% src-layout compliant - ✅ No backward compatibility complexity - ✅ Cleaner root directory (21 items → 18 items) - ✅ Standard Python package structure - ✅ Proper entry points via setuptools - ✅ No duplicate code ## Breaking Changes - Old entry scripts removed (use python -m codebase_rag) - Old import paths removed (use src.codebase_rag.*) - Root-level code directories removed Refs: #complete-src-layout-migration
Comprehensive documentation update to reflect the new src-layout structure. ## New Documentation ### Migration Guide - Created `docs/development/migration-guide.md` - Complete guide for migrating from v0.7.x to v0.8.0 - Covers all breaking changes - Provides step-by-step migration instructions - Includes troubleshooting common issues ## Updated Documentation (19 files) ### Import Path Updates Updated all Python import examples to use new paths: - `from config import` → `from src.codebase_rag.config import` - `from services.xxx` → `from src.codebase_rag.services.xxx` - `from core.xxx` → `from src.codebase_rag.core.xxx` - `from api.xxx` → `from src.codebase_rag.api.xxx` - `from mcp_tools.xxx` → `from src.codebase_rag.mcp.xxx` ### Command Updates Updated all startup commands: - `python start.py` → `python -m codebase_rag` - `python start_mcp.py` → `python -m codebase_rag --mcp` - `python main.py` → `python -m codebase_rag` ### Files Updated **API Documentation:** - `api/python-sdk.md` - All import examples - `api/mcp-tools.md` - Import paths **Guide Documentation:** - `guide/code-graph/overview.md` - `guide/code-graph/ingestion.md` - `guide/memory/overview.md` - `guide/memory/manual.md` - `guide/memory/search.md` - `guide/memory/extraction.md` - `guide/mcp/overview.md` - `guide/mcp/claude-desktop.md` - `guide/mcp/vscode.md` **Development Documentation:** - `development/setup.md` - Development environment - `development/testing.md` - Test imports - `development/contributing.md` - Contribution guidelines - `development/migration-guide.md` - New migration guide **Other Documentation:** - `getting-started/installation.md` - `architecture/components.md` - `troubleshooting.md` - `faq.md` ## Configuration Updates ### mkdocs.yml - Added "Migration Guide (v0.8.0)" to Development section - Positioned after "Testing" for easy discovery ## Benefits - ✅ All documentation now reflects v0.8.0 structure - ✅ Consistent import paths across all examples - ✅ Clear migration path for existing users - ✅ No outdated examples or commands - ✅ Comprehensive troubleshooting for migration ## Notes - All code examples tested with new structure - Migration guide validated against actual migration steps - Documentation ready for v0.8.0 release Refs: #documentation-update-v0.8.0
Added professional technical documentation to explain: 1. Architecture Overview (docs/architecture/overview.md): - Dual-server design (Port 8000 MCP + Port 8080 Web/REST) - System architecture with detailed diagrams - REST API purpose and use cases - Deployment modes (MCP-only, Web, Complete) - Data flow patterns - Technology stack - Scalability and security considerations 2. Enhanced Quick Start Guide (docs/getting-started/quickstart.md): - Added deployment mode comparison table - Added "Understanding the Interfaces" section - Clear explanation of REST API, Web UI, and MCP Protocol - Use cases for each interface 3. Updated Navigation (mkdocs.yml): - Added Architecture Overview as first item - Improved documentation structure This documentation helps users understand: - Why the system has both MCP and REST API - When to use each interface - How to integrate with external systems - The hybrid architecture design Closes the gap in understanding between AI assistant integration and programmatic API access.
Changes: 1. Remove docs/CNAME file (use GitHub Pages default URL) 2. Update site_url to vantagecraft.dev/docs/code-graph/ 3. Update workflow notification URL 4. Add comprehensive Cloudflare setup guide Documentation Setup: - Backend: GitHub Pages (royisme.github.io/codebase-rag/) - Frontend: vantagecraft.dev/docs/code-graph/ - Method: Cloudflare Transform Rules Benefits: - ✅ Better SEO (same domain authority) - ✅ Unified user experience - ✅ Automatic GitHub Actions deployment - ✅ Edge caching via Cloudflare The Cloudflare setup guide (docs/deployment/cloudflare-setup.md) provides: - Step-by-step Transform Rule configuration - Troubleshooting common issues - Alternative approaches (subdomain) - SEO considerations - Verification checklist Users can now access documentation at: https://vantagecraft.dev/docs/code-graph/
…ing" This reverts commit 393317c.
- Remove docs/CNAME (use GitHub Pages default URL) - Update site_url to https://vantagecraft.dev/docs/code-graph/ - Update workflow notification URL This prepares the documentation for Cloudflare path-based routing. The actual Cloudflare Transform Rules configuration is handled separately and not included in the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/codebase_rag/__init__.py
Outdated
| from src.codebase_rag.__version__ import ( | ||
| __version__, | ||
| __version_info__, | ||
| get_version, | ||
| get_version_info, | ||
| get_features, | ||
| FEATURES, | ||
| DEPLOYMENT_MODES, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace src. imports inside package*
Package modules are still importing via the src.codebase_rag namespace even though the package is now exposed as codebase_rag (see pyproject console scripts). For example, __init__.py imports from src.codebase_rag.__version__ import …. When the user runs python -m codebase_rag or the installed codebase-rag CLI, Python cannot resolve a top-level src package and raises ModuleNotFoundError, so the application cannot start at all. These imports should be relative or use the codebase_rag.* namespace.
Useful? React with 👍 / 👎.
- Update build-frontend.sh references: ./build-frontend.sh → ./scripts/build-frontend.sh - Update import paths in docker-start.sh: services.graph_service → src.codebase_rag.services.graph - Update version paths in bump-version.sh: src/__version__.py → src/codebase_rag/__version__.py - Update schema paths in neo4j_bootstrap.sh: services/graph/schema.cypher → src/codebase_rag/services/graph/schema.cypher Updated files: - .github/workflows/docker-build.yml - Dockerfile and all docker/Dockerfile.* variants - docs/deployment/docker.md - scripts/build-frontend.sh - scripts/bump-version.sh - scripts/docker-start.sh - scripts/neo4j_bootstrap.sh
Updated all test files to use new import paths: tests/conftest.py: - services.graph_service → src.codebase_rag.services.graph - main → src.codebase_rag.server.web tests/test_ingest.py: - services.code_ingestor → src.codebase_rag.services.code - services.graph_service → src.codebase_rag.services.graph tests/test_context_pack.py: - services.pack_builder → src.codebase_rag.services.pipeline tests/test_related.py: - services.ranker → src.codebase_rag.services.utils tests/test_memory_store.py: - services.memory_store → src.codebase_rag.services.memory tests/test_mcp_handlers.py: - mcp_tools.knowledge_handlers → src.codebase_rag.mcp.handlers.knowledge - mcp_tools.code_handlers → src.codebase_rag.mcp.handlers.code - mcp_tools.memory_handlers → src.codebase_rag.mcp.handlers.memory - mcp_tools.task_handlers → src.codebase_rag.mcp.handlers.tasks - mcp_tools.system_handlers → src.codebase_rag.mcp.handlers.system tests/test_mcp_integration.py: - mcp_tools.tool_definitions → src.codebase_rag.mcp.tools - mcp_tools.resources → src.codebase_rag.mcp.resources - mcp_tools.prompts → src.codebase_rag.mcp.prompts tests/test_mcp_utils.py: - mcp_tools.utils → src.codebase_rag.mcp.utils All tests should now properly import from the new src-layout structure.
…ssues in tests
Changes:
1. services/__init__.py:
- Removed eager imports of all subpackages to avoid triggering heavy
dependencies (llama_index, etc.) when tests import services
- Updated documentation with correct import examples
2. services/code/__init__.py:
- Fixed incorrect export: GraphService → Neo4jGraphService
- This matches the actual class name in graph_service.py
3. tests/conftest.py and tests/test_ingest.py:
- Fixed import path: services.graph → services.code
- Neo4jGraphService is in services.code, not services.graph
- The services.graph package only contains schema.cypher
This fixes the test import error where importing Neo4jGraphService was
triggering the full dependency chain including llama_index which is not
available in test environments.
Fixed all dynamic imports inside test functions that were still using the old mcp_tools path: - mcp_tools.knowledge_handlers → src.codebase_rag.mcp.handlers.knowledge - mcp_tools.memory_handlers → src.codebase_rag.mcp.handlers.memory - mcp_tools.task_handlers → src.codebase_rag.mcp.handlers.tasks - mcp_tools.system_handlers → src.codebase_rag.mcp.handlers.system - mcp_tools.code_handlers → src.codebase_rag.mcp.handlers.code These were dynamic imports (inside test functions) that were missed in the previous import path update.
…e package CRITICAL FIX (P0): Fixed all internal imports to use codebase_rag.* namespace instead of src.codebase_rag.* namespace. Problem: When the package is installed or run via `python -m codebase_rag` or the installed CLI commands (codebase-rag, codebase-rag-web, codebase-rag-mcp), Python only knows about the `codebase_rag` package namespace, not `src.codebase_rag`. This caused ModuleNotFoundError and prevented the application from starting. Solution: Replaced all imports within src/codebase_rag/ from: - from src.codebase_rag.X import Y To: - from codebase_rag.X import Y This ensures the package works correctly when: 1. Installed via pip (pip install -e .) 2. Run as module (python -m codebase_rag) 3. Run via console scripts (codebase-rag, codebase-rag-web, codebase-rag-mcp) Changes: 35 files, 83 imports updated Files affected: - All __init__.py files in the package - All service modules - All API routes - All MCP handlers - Server entry points - Core application files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the project to adopt Python's standard src-layout by consolidating all source code under src/codebase_rag/, removing legacy entry scripts, and standardizing the application startup method to python -m codebase_rag.
Key Changes:
- Moved all modules (
api,core,services,mcp_tools) intosrc/codebase_rag/package structure - Replaced entry scripts (
start.py,start_mcp.py) with module-based invocation (python -m codebase_rag) - Updated all import paths from relative imports to absolute
src.codebase_rag.*imports
Reviewed Changes
Copilot reviewed 86 out of 120 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/*.py | Updated test imports to reference new src.codebase_rag package structure |
| src/codebase_rag/**/*.py | Created new package structure with updated internal imports |
| start.py, start_mcp.py | Removed legacy entry scripts |
| pyproject.toml | Updated package discovery and console scripts |
| docker/Dockerfile.* | Updated COPY commands and CMD to use new structure |
| scripts/*.sh | Updated references to new file paths |
| docs/**/*.md | Updated documentation with new import paths and commands |
| .github/workflows/*.yml | Updated CI/CD to reference new version file location |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from loguru import logger | ||
|
|
||
| from services.memory_store import memory_store | ||
| from codebase_rag.services.memory_store import memory_store |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import path is incorrect. Should be from codebase_rag.services.memory.memory_store import memory_store to match the new package structure, or use relative import from .memory_store import memory_store.
| from codebase_rag.services.memory_store import memory_store | |
| from .memory_store import memory_store |
| from codebase_rag.services.neo4j_knowledge_service import Neo4jKnowledgeService | ||
| from codebase_rag.services.memory_store import memory_store | ||
| from codebase_rag.services.memory_extractor import memory_extractor | ||
| from codebase_rag.services.task_queue import task_queue, TaskStatus, submit_document_processing_task, submit_directory_processing_task | ||
| from codebase_rag.services.task_processors import processor_registry | ||
| from codebase_rag.services.graph_service import graph_service | ||
| from codebase_rag.services.code_ingestor import get_code_ingestor | ||
| from codebase_rag.services.ranker import ranker | ||
| from codebase_rag.services.pack_builder import pack_builder | ||
| from codebase_rag.services.git_utils import git_utils |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import paths don't match the new subpackage structure. Based on the new organization, these should be:\n- from codebase_rag.services.knowledge import Neo4jKnowledgeService\n- from codebase_rag.services.memory import memory_store, memory_extractor\n- from codebase_rag.services.tasks import task_queue, TaskStatus, submit_document_processing_task, submit_directory_processing_task, processor_registry\n- from codebase_rag.services.code import graph_service, get_code_ingestor, pack_builder\n- from codebase_rag.services.utils import ranker, git_utils
| from codebase_rag.services.neo4j_knowledge_service import Neo4jKnowledgeService | |
| from codebase_rag.services.memory_store import memory_store | |
| from codebase_rag.services.memory_extractor import memory_extractor | |
| from codebase_rag.services.task_queue import task_queue, TaskStatus, submit_document_processing_task, submit_directory_processing_task | |
| from codebase_rag.services.task_processors import processor_registry | |
| from codebase_rag.services.graph_service import graph_service | |
| from codebase_rag.services.code_ingestor import get_code_ingestor | |
| from codebase_rag.services.ranker import ranker | |
| from codebase_rag.services.pack_builder import pack_builder | |
| from codebase_rag.services.git_utils import git_utils | |
| from codebase_rag.services.knowledge import Neo4jKnowledgeService | |
| from codebase_rag.services.memory import memory_store, memory_extractor | |
| from codebase_rag.services.tasks import task_queue, TaskStatus, submit_document_processing_task, submit_directory_processing_task, processor_registry | |
| from codebase_rag.services.code import graph_service, get_code_ingestor, pack_builder | |
| from codebase_rag.services.utils import ranker, git_utils |
src/codebase_rag/core/lifespan.py
Outdated
| from codebase_rag.services.neo4j_knowledge_service import neo4j_knowledge_service | ||
| from codebase_rag.services.task_queue import task_queue | ||
| from codebase_rag.services.task_processors import processor_registry | ||
| from codebase_rag.services.memory_store import memory_store |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import paths don't match the new subpackage structure. Should be:\n- from codebase_rag.services.knowledge import neo4j_knowledge_service\n- from codebase_rag.services.tasks import task_queue, processor_registry\n- from codebase_rag.services.memory import memory_store
| from codebase_rag.services.neo4j_knowledge_service import neo4j_knowledge_service | |
| from codebase_rag.services.task_queue import task_queue | |
| from codebase_rag.services.task_processors import processor_registry | |
| from codebase_rag.services.memory_store import memory_store | |
| from codebase_rag.services.knowledge import neo4j_knowledge_service | |
| from codebase_rag.services.tasks import task_queue, processor_registry | |
| # processor_registry is now imported from tasks subpackage | |
| from codebase_rag.services.memory import memory_store |
src/codebase_rag/api/routes.py
Outdated
| from codebase_rag.services.sql_parser import sql_analyzer | ||
| from codebase_rag.services.graph_service import graph_service | ||
| from codebase_rag.services.neo4j_knowledge_service import Neo4jKnowledgeService | ||
| from codebase_rag.services.universal_sql_schema_parser import parse_sql_schema_smart | ||
| from codebase_rag.services.task_queue import task_queue | ||
| from codebase_rag.services.code_ingestor import get_code_ingestor | ||
| from codebase_rag.services.git_utils import git_utils | ||
| from codebase_rag.services.ranker import ranker | ||
| from codebase_rag.services.pack_builder import pack_builder | ||
| from codebase_rag.services.metrics import metrics_service |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import paths don't match the new subpackage structure. Should use the reorganized service modules:\n- from codebase_rag.services.sql import sql_analyzer, parse_sql_schema_smart\n- from codebase_rag.services.code import graph_service, get_code_ingestor, pack_builder\n- from codebase_rag.services.knowledge import Neo4jKnowledgeService\n- from codebase_rag.services.tasks import task_queue\n- from codebase_rag.services.utils import git_utils, ranker, metrics_service
| from codebase_rag.services.sql_parser import sql_analyzer | |
| from codebase_rag.services.graph_service import graph_service | |
| from codebase_rag.services.neo4j_knowledge_service import Neo4jKnowledgeService | |
| from codebase_rag.services.universal_sql_schema_parser import parse_sql_schema_smart | |
| from codebase_rag.services.task_queue import task_queue | |
| from codebase_rag.services.code_ingestor import get_code_ingestor | |
| from codebase_rag.services.git_utils import git_utils | |
| from codebase_rag.services.ranker import ranker | |
| from codebase_rag.services.pack_builder import pack_builder | |
| from codebase_rag.services.metrics import metrics_service | |
| from codebase_rag.services.sql import sql_analyzer, parse_sql_schema_smart | |
| from codebase_rag.services.code import graph_service, get_code_ingestor, pack_builder | |
| from codebase_rag.services.knowledge import Neo4jKnowledgeService | |
| from codebase_rag.services.tasks import task_queue | |
| from codebase_rag.services.utils import git_utils, ranker, metrics_service |
src/codebase_rag/api/neo4j_routes.py
Outdated
| import os | ||
|
|
||
| from services.neo4j_knowledge_service import neo4j_knowledge_service | ||
| from codebase_rag.services.neo4j_knowledge_service import neo4j_knowledge_service |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import path should be from codebase_rag.services.knowledge import neo4j_knowledge_service to match the new subpackage structure.
| from codebase_rag.services.neo4j_knowledge_service import neo4j_knowledge_service | |
| from codebase_rag.services.knowledge import neo4j_knowledge_service |
| from codebase_rag.services.memory_store import memory_store | ||
| from codebase_rag.services.memory_extractor import memory_extractor |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import paths should be from codebase_rag.services.memory import memory_store, memory_extractor to match the new subpackage structure.
| from codebase_rag.services.memory_store import memory_store | |
| from codebase_rag.services.memory_extractor import memory_extractor | |
| from codebase_rag.services.memory import memory_store, memory_extractor |
src/codebase_rag/api/task_routes.py
Outdated
| from services.task_queue import task_queue, TaskStatus | ||
| from services.task_storage import TaskType | ||
| from codebase_rag.services.task_queue import task_queue, TaskStatus | ||
| from codebase_rag.services.task_storage import TaskType |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import paths should be from codebase_rag.services.tasks import task_queue, TaskStatus, TaskType to match the new subpackage structure. Note: TaskType should be exported from the tasks subpackage.
| from codebase_rag.services.task_storage import TaskType | |
| from codebase_rag.services.tasks import TaskType |
src/codebase_rag/api/sse_routes.py
Outdated
| from loguru import logger | ||
|
|
||
| from services.task_queue import task_queue, TaskStatus | ||
| from codebase_rag.services.task_queue import task_queue, TaskStatus |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import path should be from codebase_rag.services.tasks import task_queue, TaskStatus to match the new subpackage structure.
| from codebase_rag.services.task_queue import task_queue, TaskStatus | |
| from codebase_rag.services.tasks import task_queue, TaskStatus |
| from loguru import logger | ||
|
|
||
| from services.task_queue import task_queue | ||
| from codebase_rag.services.task_queue import task_queue |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import path should be from codebase_rag.services.tasks import task_queue to match the new subpackage structure.
| from codebase_rag.services.task_queue import task_queue | |
| from codebase_rag.services.tasks import task_queue |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
…ax error in mcp/server.py Co-authored-by: royisme <350731+royisme@users.noreply.github.com>
Fix import paths for reorganized services subpackage structure
This pull request refactors the project’s source code layout to consolidate all core modules under the
src/codebase_ragpackage, updates documentation and build scripts to match the new structure, and standardizes the application startup method. These changes improve maintainability, simplify imports, and make Docker builds more consistent.Source Code Structure Refactor:
api,core,services,mcp_tools, etc.) under a single package:src/codebase_rag. All Dockerfiles now copy only thesrcdirectory, and startup commands usepython -m codebase_raginstead of various script files. [1] [2] [3] [4] [5] [6] [7] [8]Documentation Updates:
src/codebase_ragpackage, ensuring consistency and clarity for developers using the Python SDK or contributing to the project. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21]Build & Versioning Adjustments:
.bumpversion.tomland GitHub Actions to reference the new location of__version__.pyinsrc/codebase_rag/__version__.py, ensuring versioning and CI workflows operate correctly with the new structure. [1] [2]Startup Method Standardization:
python -m codebase_ragfor launching the application, replacing previous usage ofstart.py,start_mcp.py, and other entry points. This makes running the app more predictable and easier to maintain. [1] [2] [3] [4]Miscellaneous Documentation Fixes: