-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: normalize paths for Windows compatibility #5276
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
Conversation
- Add path.normalize() to expandTildePath and resolvePgliteDir functions - Normalize dataDir path in PGLite manager constructor - Fix test path construction to use path.join instead of string concatenation - Resolves 'The system cannot find the path specified' errors on Windows CI Fixes mixed path separators (backslashes/forward slashes) that were causing Windows tests to fail during PGLite database initialization and migration.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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 addresses Windows CI failures by normalizing file paths to ensure cross-platform compatibility.
- Added path.normalize() in expandTildePath() and resolvePgliteDir() to ensure OS-specific path separators.
- Updated PGliteClientManager to normalize the dataDir path.
- Modified tests to use path.join() for consistent path assembly.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/plugin-sql/src/utils.ts | Normalizes tilde-based and resolved paths to support Windows file separators |
| packages/plugin-sql/src/pglite/manager.ts | Applies path normalization for dataDir in the PGlite constructor options |
| packages/cli/tests/commands/agent.test.ts | Uses path.join() for constructing test directory paths to prevent mixed separators |
Co-authored-by: Copilot <[email protected]>
- Add path.normalize() to CLI expandTildePath function to ensure consistent separators - Add comprehensive debug logging to PGLiteClientManager constructor - Add debug logging to resolvePgliteDir function to trace path resolution - Add error handling around PGLite client creation - This complements the existing path normalization in plugin-sql utils - Should resolve 'The system cannot find the path specified' errors on Windows
- Add comprehensive debug logging to ExtensionManager to identify failing extensions - Add error details logging including error codes and paths - Add pre-installation logging to identify exact failure point - This will help pinpoint whether the issue is with vector or fuzzystrmatch extensions
…point - Add detailed database connection testing with timing and error details - Isolate each migration step (extensions, schema, namespace, introspection) with individual try-catch blocks - Add comprehensive error logging including error types, codes, and Windows-specific context - This will help identify exactly which operation is causing the repeated path errors
- Include Ada in the list of agents to explicitly load as agents - Increase registration wait time for Windows (5 seconds vs default) - This ensures Ada is available for agent get commands in tests
Problem
The Windows CI tests were failing with repeated 'The system cannot find the path specified' errors during PGLite database initialization. Investigation revealed that paths were being constructed with mixed separators, causing Windows to be unable to locate the database directory.
Root Cause
Mixed path separators in database paths:
Solution
Changes Made:
packages/plugin-sql/src/utils.ts:
packages/plugin-sql/src/pglite/manager.ts:
packages/cli/tests/commands/agent.test.ts:
Benefits:
Testing
This fix addresses the specific Windows path handling issues identified in GitHub Actions run 15878190766.
The changes use Node.js built-in path module functions which are available in Bun and properly handle cross-platform path normalization.