Refactoring the HTTP helper utility to improve clarity, extensibility, and robustness#21375
Conversation
PR Changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21375 +/- ##
==========================================
- Coverage 72.53% 72.51% -0.02%
==========================================
Files 330 330
Lines 97979 97987 +8
Branches 5431 5409 -22
==========================================
- Hits 71066 71056 -10
- Misses 26913 26931 +18
🚀 New features to boost your workflow:
|
8b7c87e to
bc1790c
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves the SQL Database Projects extension’s build-time dependency download path, focusing on better behavior behind proxies/offline, and refactors the “are required build DLLs present?” check to use the DLLs as the source of truth.
Changes:
- Add proxy-aware tunneling support for
HttpClient.download(VS Codehttp.proxy+ env var detection). - Refactor build DLL presence checks to rely on expected DLLs rather than
.nupkgpresence; add a new localized “manual DLL placement” help message when downloads fail. - Add new unit tests for proxy agent selection and for build helper failure/skip-download behavior; remove obsolete
VSCODE_DEVELOPMENT.md.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/sql-database-projects.xlf | Adds new localized string for nuget reachability/help guidance. |
| extensions/sql-database-projects/package.json | Adds tunnel + @types/tunnel dependencies for proxy tunneling. |
| extensions/sql-database-projects/yarn.lock | Locks new tunnel dependencies. |
| extensions/sql-database-projects/src/common/httpClient.ts | Adds proxy detection and tunnel agent setup for downloads. |
| extensions/sql-database-projects/src/tools/buildHelper.ts | Changes presence check to DLL-based; shows new help message on download failures. |
| extensions/sql-database-projects/src/common/constants.ts | Adds nugetDownloadFailedHelp localized helper. |
| extensions/sql-database-projects/l10n/bundle.l10n.json | Adds the new l10n key/value for the help message. |
| extensions/sql-database-projects/test/httpClient.test.ts | New tests validating tunnel variant selection and proxy priority. |
| extensions/sql-database-projects/test/buildHelper.test.ts | Adds tests for error messaging on download failure and skipping download when files exist. |
| extensions/sql-database-projects/VSCODE_DEVELOPMENT.md | Removes obsolete developer documentation file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| try { | ||
| const scheme = this.dependencies.parseUriScheme | ||
| ? this.dependencies.parseUriScheme(proxy) | ||
| : new URL(proxy).protocol; | ||
|
|
||
| if (!scheme) { | ||
| message = `Proxy settings found, but without a protocol (e.g. http://): '${proxy}'. You may encounter connection issues while using this extension.`; | ||
| localizedMessage = this.dependencies.messages?.missingProtocolWarning(proxy); | ||
| } | ||
| } catch (err) { | ||
| const errorMessage = this.getErrorMessage(err); | ||
| message = `Proxy settings found, but encountered an error while parsing the URL: '${proxy}'. You may encounter connection issues while using this extension. Error: ${errorMessage}`; | ||
| localizedMessage = this.dependencies.messages?.unparseableWarning(proxy, errorMessage); | ||
| } | ||
|
|
There was a problem hiding this comment.
warnOnInvalidProxySettings currently treats any non-empty scheme as valid (e.g. socks5://...), but createProxyAgent/getProxyAgentOptions only support http/https proxies. This can lead to no warning being shown for unsupported proxy schemes, followed by request failures later. Consider warning (and/or ignoring) proxies whose scheme is not http/https.
Description
This pull request improves the robustness of the SQL Database Projects extension's build helper, especially for environments behind a proxy or offline.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines