upgrade service downloader (#20703)

* use new service downloader

* update other extensions

* fix errors
This commit is contained in:
Alan Ren
2022-10-02 20:30:53 -07:00
committed by GitHub
parent 85dc506a3c
commit 1df976d79d
19 changed files with 88 additions and 70 deletions

View File

@@ -5,14 +5,7 @@
"Windows_86": "win-x86-net6.0.zip",
"Windows_64": "win-x64-net6.0.zip",
"OSX": "osx-x64-net6.0.tar.gz",
"CentOS_7": "rhel-x64-net6.0.tar.gz",
"Debian_8": "rhel-x64-net6.0.tar.gz",
"Fedora_23": "rhel-x64-net6.0.tar.gz",
"OpenSUSE_13_2": "rhel-x64-net6.0.tar.gz",
"RHEL_7": "rhel-x64-net6.0.tar.gz",
"SLES_12_2": "rhel-x64-net6.0.tar.gz",
"Ubuntu_14": "rhel-x64-net6.0.tar.gz",
"Ubuntu_16": "rhel-x64-net6.0.tar.gz"
"Linux": "rhel-x64-net6.0.tar.gz"
},
"installDirectory": "./sqltoolsservice/{#platform#}/{#version#}",
"executableFiles": ["MicrosoftSqlToolsServiceLayer.exe", "MicrosoftSqlToolsServiceLayer"],

View File

@@ -1332,7 +1332,7 @@
"find-remove": "1.2.1",
"request": "^2.88.0",
"request-light": "^0.3.0",
"@microsoft/ads-service-downloader": "0.2.4",
"@microsoft/ads-service-downloader": "1.0.2",
"stream-meter": "^1.0.4",
"through2": "^3.0.1",
"tough-cookie": "^3.0.1",

View File

@@ -3,12 +3,12 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IConfig, Events } from '@microsoft/ads-service-downloader';
import { IConfig, Events, LogLevel } from '@microsoft/ads-service-downloader';
import { ServerOptions, TransportKind } from 'vscode-languageclient';
import * as Constants from './constants';
import * as vscode from 'vscode';
import * as path from 'path';
import { getCommonLaunchArgsAndCleanupOldLogFiles, getOrDownloadServer, getParallelMessageProcessingConfig } from './utils';
import { getCommonLaunchArgsAndCleanupOldLogFiles, getConfigTracingLevel, getOrDownloadServer, getParallelMessageProcessingConfig, TracingLevel } from './utils';
import { Telemetry, LanguageClientErrorHandler } from './telemetry';
import { SqlOpsDataClient, ClientOptions } from 'dataprotocol-client';
import { TelemetryFeature, AgentServicesFeature, SerializationFeature, AccountFeature, SqlAssessmentServicesFeature, ProfilerFeature, TableDesignerFeature, ExecutionPlanServiceFeature } from './features';
@@ -32,6 +32,16 @@ const localize = nls.loadMessageBundle();
const outputChannel = vscode.window.createOutputChannel(Constants.serviceName);
const statusView = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
// The mapping between MSSQL log level and the service downloader log level.
const LogLevelMapping: { [key: string]: number } = {
[TracingLevel.All]: LogLevel.Verbose,
[TracingLevel.Critical]: LogLevel.Critical,
[TracingLevel.Error]: LogLevel.Error,
[TracingLevel.Information]: LogLevel.Information,
[TracingLevel.Verbose]: LogLevel.Verbose,
[TracingLevel.Warning]: LogLevel.Warning
};
export class SqlToolsServer {
private client: SqlOpsDataClient;
@@ -145,6 +155,14 @@ function handleServerProviderEvent(e: string, ...args: any[]): void {
case Events.ENTRY_EXTRACTED:
outputChannel.appendLine(localize('entryExtractedChannelMsg', "Extracted {0} ({1}/{2})", args[0], args[1], args[2]));
break;
case Events.LOG_EMITTED:
const configuredLevel: number | undefined = LogLevelMapping[getConfigTracingLevel()];
const logLevel = args[0] as LogLevel;
const message = args[1] as string;
if (configuredLevel !== undefined && logLevel >= configuredLevel) {
outputChannel.appendLine(message);
}
break;
}
}

View File

@@ -85,12 +85,25 @@ export function getConfigLogRetentionSeconds(): number {
}
}
export function getConfigTracingLevel(): string {
/**
* The tracing level defined in the package.json
*/
export enum TracingLevel {
All = 'All',
Off = 'Off',
Critical = 'Critical',
Error = 'Error',
Warning = 'Warning',
Information = 'Information',
Verbose = 'Verbose'
}
export function getConfigTracingLevel(): TracingLevel {
let config = getConfiguration();
if (config) {
return config[configTracingLevel];
} else {
return undefined;
return TracingLevel.Critical;
}
}

View File

@@ -189,10 +189,10 @@
dependencies:
nan "^2.14.0"
"@microsoft/ads-service-downloader@0.2.4":
version "0.2.4"
resolved "https://registry.yarnpkg.com/@microsoft/ads-service-downloader/-/ads-service-downloader-0.2.4.tgz#905a11eb2da19673629852d9764fb9fb94ad81bd"
integrity sha512-3J0YjH29a5pP+5Yu0HF7itRBZpNOgUN34Gh/p0Py/TQr7qUzZSXwOM+fWD1nCea+q9t8mfHr0yuy0aeDX+33vQ==
"@microsoft/ads-service-downloader@1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@microsoft/ads-service-downloader/-/ads-service-downloader-1.0.2.tgz#76cc9a44074525ac65a6ea15f8b5ee7eac87efbe"
integrity sha512-Qpc5HNLywVZbSxeUC4S7d+VRAUddrYjkIfDXl76UwCA0iuwzi71RtciEgWfCWAZMm9CbKTIbtFGh4pYw+h81nQ==
dependencies:
async-retry "^1.2.3"
eventemitter2 "^5.0.1"