-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: Use relative paths in scanner and file-watcher to avoid filterin… #8604
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
base: main
Are you sure you want to change the base?
fix: Use relative paths in scanner and file-watcher to avoid filterin… #8604
Conversation
…g workspaces under hidden parent directories - Modified scanner.ts to use relativeFilePath instead of filePath when checking isPathInIgnoredDirectory - Modified file-watcher.ts to calculate relativeFilePath earlier and use it for isPathInIgnoredDirectory check - This prevents workspaces located under hidden parent directories (e.g., .root) from being incorrectly filtered out during both initial indexing and file watching - Ensures both initial indexing and incremental updates work correctly for all workspace locations
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.
The fix correctly addresses the issue by using relative paths instead of absolute paths when checking for ignored directories. This prevents workspaces under hidden parent directories from being filtered out. However, there's a gap in test coverage for this specific scenario.
…s in FileWatcher and DirectoryScanner
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.
The fix correctly addresses the issue by using relative paths when checking for ignored directories. However, there's a critical test failure that needs to be fixed before merging.
src/services/code-index/processors/__tests__/file-watcher.spec.ts
Outdated
Show resolved
Hide resolved
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.
All previous review comments have been successfully addressed. The fix correctly uses relative paths to prevent filtering out workspaces under hidden parent directories, and comprehensive test coverage has been added.
Related GitHub Issue
Closes: #8600
Description
This PR fixes the indexer to work correctly when the workspace is located under hidden parent directories (e.g., .root, .config).
The Problem:
Both scanner.ts and file-watcher.ts were using absolute file paths when checking isPathInIgnoredDirectory(), causing the entire workspace to be filtered out if any parent directory started with a dot.
The Solution:
Test Procedure
Manual Testing:
Verification:
Reviewers can test by cloning the repo into a directory like .test/project and running "Start indexing" - points should be created successfully.
Pre-Submission Checklist
Important
Use relative paths in
file-watcher.tsandscanner.tsto prevent filtering out workspaces under hidden directories.isPathInIgnoredDirectory()infile-watcher.tsandscanner.tsto prevent filtering out workspaces under hidden directories.relativeFilePathcalculation earlier infile-watcher.tsfor ignore checks.This description was created by
for 9c0864c. You can customize this summary. It will automatically update as commits are pushed.