Bundling sqltoolsserivce with extension.#21631
Conversation
- Updated package.json to include ms-dotnettools.vscode-dotnet-runtime as a dependency. - Modified package-extension.js to handle portable SQL Tools Service packaging. - Introduced dotnetRuntimeProvider for acquiring .NET runtime paths. - Enhanced server.ts to prioritize platform-specific paths and fall back to portable paths. - Added unit tests for dotnetRuntimeProvider and updated existing tests for server functionality.
PR Changes
|
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (60.54%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #21631 +/- ##
==========================================
- Coverage 73.04% 73.02% -0.02%
==========================================
Files 327 328 +1
Lines 99044 99205 +161
Branches 5602 5613 +11
==========================================
+ Hits 72346 72448 +102
- Misses 26698 26757 +59
🚀 New features to boost your workflow:
|
| run: | | ||
| cd extensions/mssql | ||
| vsce package | ||
| yarn package |
There was a problem hiding this comment.
Using our custom packing script to bundle the portable runtime.
| }, | ||
| installDir: "./sqltoolsservice/{#version#}/{#platform#}", | ||
| executableFiles: [ | ||
| "MicrosoftSqlToolsServiceLayer.dll", |
There was a problem hiding this comment.
DLL have a higher priority over .exe or .sh files as portable STS just has dlls.
extensions/mssql/package.json
Outdated
| "extensionDependencies": [ | ||
| "vscode.sql" | ||
| "vscode.sql", | ||
| "ms-dotnettools.vscode-dotnet-runtime" |
There was a problem hiding this comment.
We need a hard dependency on runtime extension as launching without it should fail extension activation.
…d update tests to reflect changes
… handling and logging
kburtram
left a comment
There was a problem hiding this comment.
I wonder if we should do this in the insider/prerelease build for a while before pushing to stable?
There was a problem hiding this comment.
Pull request overview
This PR updates the MSSQL extension packaging and activation flow to support bundling SQL Tools Service (STS) directly in OS-specific “offline” VSIX packages, while keeping an “online” package that uses a portable/framework-dependent STS and acquires a .NET runtime via ms-dotnettools.vscode-dotnet-runtime.
Changes:
- Introduces a portable STS runtime option and activation logic that prefers bundled platform-specific STS, then portable STS, then download.
- Adds a
DotnetRuntimeProviderthat usesdotnet.acquireto obtain a .NET 8 runtime when launching framework-dependent STS/.dll services. - Updates packaging scripts and CI workflows to build online/offline VSIX variants and package via
yarn package.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Adds new localizable strings for runtime/service startup error UX actions. |
| extensions/mssql/l10n/bundle.l10n.json | Updates runtime localization bundle with the new strings. |
| extensions/mssql/src/models/platform.ts | Adds Runtime.Portable and display name handling. |
| extensions/mssql/src/configurations/config.ts | Adds portable STS download filename + .NET runtime version; adjusts executable file search order. |
| extensions/mssql/src/constants/constants.ts | Adds constants for dotnet runtime extension/command and offline VSIX URL. |
| extensions/mssql/src/constants/locConstants.ts | Adds ServiceClient localized strings for runtime/service startup failures and actions. |
| extensions/mssql/src/languageservice/dotnetRuntimeProvider.ts | New provider to acquire a .NET runtime via dotnet.acquire. |
| extensions/mssql/src/languageservice/server.ts | Updates STS path resolution priority: platform-specific first, then portable; handles missing paths more safely. |
| extensions/mssql/src/languageservice/serviceclient.ts | Switches download fallback to portable STS and launches .dll services via acquired dotnet; adds failure UX with offline VSIX guidance. |
| extensions/mssql/scripts/package-extension.js | Splits packaging into online (portable STS) vs offline (platform self-contained STS) and adjusts manifest deps for offline packages. |
| extensions/mssql/test/unit/serviceInstallerUtils.test.ts | Removes commented-out unused test snippet. |
| extensions/mssql/test/unit/serviceClient.test.ts | Updates SqlToolsServiceClient construction to include the new runtime provider dependency. |
| extensions/mssql/test/unit/server.test.ts | Adds/updates tests for new server path priority and download behavior. |
| extensions/mssql/test/unit/dotnetRuntimeProvider.test.ts | Adds unit tests for dotnet runtime acquisition behavior. |
| extensions/mssql/test/e2e/utils/launchVscodeWithMsSqlExt.ts | Installs the dotnet runtime extension before launch; refactors VSIX/extension install flow. |
| .github/workflows/build-and-test.yml | Switches packaging steps to yarn package; adds baseline size reporting for keymap VSIX. |
| .github/workflows/publish-baseline.yml | Switches baseline packaging steps to yarn package. |
…andling and caching
Description
Fixes: #17992
Packaging is now split into two modes:
ms-dotnettools.vscode-dotnet-runtime.On activation, the extension now resolves SQL Tools Service in this order:
When the portable STS is used, the extension acquires a .NET 8 runtime via
dotnet.acquirefromms-dotnettools.vscode-dotnet-runtime.If portable STS download fails or .NET runtime acquisition fails, the user is shown an error with guidance to install the offline VSIX.
Tasks left.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines