-
Notifications
You must be signed in to change notification settings - Fork 555
Fix dacpac path resolution on macOS with Windows-style separators #20824
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?
Conversation
- Added path separator normalization in readProjectProperties() to convert Windows backslashes to forward slashes - This fixes the issue where dacpac files couldn't be found on macOS when relative paths contained Windows-style backslashes - Added test coverage for path normalization scenarios Co-authored-by: Benjin <[email protected]>
- Updated to use normalizedOutputPath for path.isAbsolute() check - This ensures absolute paths with Windows backslashes are also normalized - Added test coverage for absolute paths with backslashes Co-authored-by: Benjin <[email protected]>
| import { readProjectProperties } from "../../src/publishProject/projectUtils"; | ||
| import { SqlProjectsService } from "../../src/services/sqlProjectsService"; | ||
|
|
||
| suite("projectUtils Tests", () => { |
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.
@copilot We already have a publish‑project test file (PublishProjectWebViewController.test.ts). Instead of creating a new test file, could you add your tests to the existing one?
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.
Actually, I think we should create a new file here. We try to keep the unit tests in identically-named files so that they're easy to locate.
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.
Can we publish this PR and test it with any MacOS, @Benjin IIRC you have the Mac right, can you test the fix, please!
PR Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20824 +/- ##
==========================================
- Coverage 65.90% 65.90% -0.01%
==========================================
Files 210 210
Lines 19991 19992 +1
Branches 2596 2596
==========================================
Hits 13176 13176
Misses 6718 6718
- Partials 97 98 +1
🚀 New features to boost your workflow:
|
Description
On macOS, the publish dialog fails to locate dacpac files when
result.outputPathcontains Windows-style backslashes (e.g.,bin\Debug). Node.jspath.join()on Unix doesn't convert these to forward slashes, producing malformed paths like/Users/.../project/bin\Debug/project.dacpac.Changes:
readProjectProperties()by replacing backslashes with forward slashes beforepath.join()andpath.isAbsolute()callsCode Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com/usr/local/bin/node /usr/local/bin/node ./out/test/unit/runTest.js --grep projectUtils(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.