Skip to content

Refactoring the HTTP helper utility to improve clarity, extensibility, and robustness#21375

Merged
ssreerama merged 23 commits into
mainfrom
sai/mar/sqlproj_offlineDwnld_Issue
Mar 6, 2026
Merged

Refactoring the HTTP helper utility to improve clarity, extensibility, and robustness#21375
ssreerama merged 23 commits into
mainfrom
sai/mar/sqlproj_offlineDwnld_Issue

Conversation

@ssreerama
Copy link
Copy Markdown
Contributor

@ssreerama ssreerama commented Feb 26, 2026

Description

This pull request improves the robustness of the SQL Database Projects extension's build helper, especially for environments behind a proxy or offline.

  • Added full support for HTTP(S) proxy detection and tunneling in HttpClient
  • Updated dependencies to include the tunnel package and its types for proxy support
  • Added a localized message guiding users on how to manually place required DLLs if nuget.org is unreachable and dlls are not present.
  • Refactored the check for required build DLLs
    • The presence of DLLs themselves is now the source of truth.
    • Not the presence of a .nupkg file
  • Added new tests to verify correct error messaging when downloads fail and to confirm that downloads are skipped
  • Removed the obsolete VSCODE_DEVELOPMENT.md documentation file

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines

Http_tunnel_BuildOffline

@ssreerama ssreerama changed the title Sai/mar/sqlproj offline dwnld issue refactoring the HTTP helper utility to improve clarity, extensibility, and robustness Feb 26, 2026
@ssreerama ssreerama changed the title refactoring the HTTP helper utility to improve clarity, extensibility, and robustness Refactoring the HTTP helper utility to improve clarity, extensibility, and robustness Feb 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 26, 2026

PR Changes

Category Target Branch PR Branch Difference
vscode-mssql VSIX 6402 KB 6400 KB ⚪ -2 KB ( 0% )
sql-database-projects VSIX 7025 KB 7057 KB ⚪ 32 KB ( 0% )
data-workspace VSIX 535 KB 535 KB ⚪ 0 KB ( 0% )

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.51%. Comparing base (0370a76) to head (07c2901).
⚠️ Report is 31 commits behind head on main.

Files with missing lines Patch % Lines
extensions/mssql/src/http/httpClientCore.ts 80.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
extensions/mssql/src/constants/locConstants.ts 76.21% <100.00%> (ø)
extensions/mssql/src/http/httpClientCore.ts 84.86% <80.00%> (-3.50%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ssreerama ssreerama force-pushed the sai/mar/sqlproj_offlineDwnld_Issue branch from 8b7c87e to bc1790c Compare February 27, 2026 20:00
@ssreerama ssreerama marked this pull request as ready for review February 27, 2026 20:17
Copilot AI review requested due to automatic review settings February 27, 2026 20:17
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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 Code http.proxy + env var detection).
  • Refactor build DLL presence checks to rely on expected DLLs rather than .nupkg presence; 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.

Comment thread localization/xliff/sql-database-projects.xlf
Comment thread extensions/sql-database-projects/src/tools/buildHelper.ts
Comment thread extensions/sql-database-projects/src/common/httpClient.ts Outdated
Copilot AI review requested due to automatic review settings February 28, 2026 21:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread localization/xliff/sql-database-projects.xlf
Comment thread extensions/sql-database-projects/src/tools/buildHelper.ts
Comment thread extensions/sql-database-projects/src/common/httpClient.ts Outdated
Comment thread extensions/sql-database-projects/src/common/constants.ts
Comment thread extensions/sql-database-projects/src/common/httpClient.ts Outdated
Comment thread extensions/sql-database-projects/test/httpClient.test.ts
Copilot AI review requested due to automatic review settings March 5, 2026 01:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread extensions/sql-database-projects/test/httpClient.test.ts
Comment thread extensions/sql-database-projects/src/tools/buildHelper.ts Outdated
Comment thread extensions/sql-database-projects/src/http/httpClientCore.ts
Comment thread extensions/sql-database-projects/src/http/httpClientCore.ts
Comment thread extensions/mssql/src/http/httpClientCore.ts Outdated
@ssreerama ssreerama requested a review from Benjin March 5, 2026 18:54
Copilot AI review requested due to automatic review settings March 5, 2026 19:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread extensions/mssql/src/http/httpClientCore.ts Outdated
Comment thread extensions/mssql/src/http/httpClientCore.ts
Comment thread extensions/sql-database-projects/src/tools/buildHelper.ts Outdated
@ssreerama ssreerama requested a review from Benjin March 6, 2026 16:26
Copilot AI review requested due to automatic review settings March 6, 2026 16:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread extensions/mssql/src/http/httpClientCore.ts
Comment thread extensions/sql-database-projects/test/httpClient.test.ts
Comment thread extensions/sql-database-projects/src/tools/buildHelper.ts Outdated
Comment thread extensions/sql-database-projects/src/common/constants.ts
Comment thread extensions/sql-database-projects/src/http/httpClientCore.ts
Copilot AI review requested due to automatic review settings March 6, 2026 20:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread localization/xliff/vscode-mssql.xlf
Comment on lines +176 to +190
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);
}

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@ssreerama ssreerama merged commit 2d83148 into main Mar 6, 2026
3 checks passed
@ssreerama ssreerama deleted the sai/mar/sqlproj_offlineDwnld_Issue branch March 6, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SQL Database Projects extension should not require NuGet access at build time

4 participants