refactor: Migrate document reindexing to UploadDocumentAdapter with unified indexing pipeline#842
Conversation
|
@AnishSarkar22 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 1e4b8d3..ce82807
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (4)
• surfsense_backend/app/indexing_pipeline/adapters/file_upload_adapter.py
• surfsense_backend/app/tasks/celery_tasks/document_reindex_tasks.py
• surfsense_backend/app/tasks/document_processors/file_processors.py
• surfsense_backend/tests/integration/indexing_pipeline/adapters/test_file_upload_adapter.py
UploadDocumentAdapter with unified indexing pipeline
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on ce82807..b2bf00e
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (1)
• surfsense_backend/tests/integration/indexing_pipeline/adapters/test_file_upload_adapter.py
Description
index_uploaded_filefunction intoUploadDocumentAdapterclass withindex()andreindex()public methods, both routing throughIndexingPipelineService.document_reindex_tasks.pywith a singleadapter.reindex()call.llm_router_service.Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR refactors the document indexing logic by converting the standalone
index_uploaded_filefunction into anUploadDocumentAdapterclass with separateindex()andreindex()methods. The newreindex()method replaces the legacy manual reindexing logic in the Celery task handler, routing both workflows through the unifiedIndexingPipelineService. The changes also include comprehensive test coverage expansion from 4 to 11 tests, covering various reindexing scenarios including content hash updates, chunk replacement, empty markdown guards, and error handling.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_backend/app/indexing_pipeline/adapters/file_upload_adapter.pysurfsense_backend/tests/integration/indexing_pipeline/adapters/test_file_upload_adapter.pysurfsense_backend/app/tasks/celery_tasks/document_reindex_tasks.pysurfsense_backend/app/tasks/document_processors/file_processors.py