mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
VS Code merge to df8fe74bd55313de0dd2303bc47a4aab0ca56b0e (#17979)
* Merge from vscode 504f934659740e9d41501cad9f162b54d7745ad9 * delete unused folders * distro * Bump build node version * update chokidar * FIx hygiene errors * distro * Fix extension lint issues * Remove strict-vscode * Add copyright header exemptions * Bump vscode-extension-telemetry to fix webpacking issue with zone.js * distro * Fix failing tests (revert marked.js back to current one until we decide to update) * Skip searchmodel test * Fix mac build * temp debug script loading * Try disabling coverage * log error too * Revert "log error too" This reverts commit af0183e5d4ab458fdf44b88fbfab9908d090526f. * Revert "temp debug script loading" This reverts commit 3d687d541c76db2c5b55626c78ae448d3c25089c. * Add comments explaining coverage disabling * Fix ansi_up loading issue * Merge latest from ads * Use newer option * Fix compile * add debug logging warn * Always log stack * log more * undo debug * Update to use correct base path (+cleanup) * distro * fix compile errors * Remove strict-vscode * Fix sql editors not showing * Show db dropdown input & fix styling * Fix more info in gallery * Fix gallery asset requests * Delete unused workflow * Fix tapable resolutions for smoke test compile error * Fix smoke compile * Disable crash reporting * Disable interactive Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { isLinuxSnap, PlatformToString, platform, Platform } from 'vs/base/common/platform';
|
||||
import { platform as nodePlatform, env } from 'vs/base/common/process';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { isLinuxSnap, platform, Platform, PlatformToString } from 'vs/base/common/platform';
|
||||
import { env, platform as nodePlatform } from 'vs/base/common/process';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
|
||||
import product from 'vs/platform/product/common/product'; // {{SQL CARBON EDIT}}
|
||||
const productObject = product; // {{SQL CARBON EDIT}}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { binarySearch } from 'vs/base/common/arrays';
|
||||
import * as Errors from 'vs/base/common/errors';
|
||||
import { toDisposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { safeStringify } from 'vs/base/common/objects';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
export interface IPropertyData {
|
||||
classification: 'SystemMetaData' | 'CallstackOrException' | 'CustomerContent' | 'PublicNonPersonalData' | 'EndUserPseudonymizedInformation';
|
||||
purpose: 'PerformanceAndHealth' | 'FeatureInsight' | 'BusinessInsight';
|
||||
expiration?: string;
|
||||
endpoint?: string;
|
||||
isMeasurement?: boolean;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
|
||||
export const ITelemetryService = createDecorator<ITelemetryService>('telemetryService');
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
||||
export interface ITelemetryLog {
|
||||
eventName: string;
|
||||
|
||||
@@ -14,12 +14,19 @@ export class TelemetryLogAppender extends Disposable implements ITelemetryAppend
|
||||
|
||||
constructor(
|
||||
@ILoggerService loggerService: ILoggerService,
|
||||
@IEnvironmentService environmentService: IEnvironmentService
|
||||
@IEnvironmentService environmentService: IEnvironmentService,
|
||||
private readonly prefix: string = '',
|
||||
) {
|
||||
super();
|
||||
this.logger = this._register(loggerService.createLogger(environmentService.telemetryLogResource));
|
||||
this.logger.info('The below are logs for every telemetry event sent from VS Code once the log level is set to trace.');
|
||||
this.logger.info('===========================================================');
|
||||
|
||||
const logger = loggerService.getLogger(environmentService.telemetryLogResource);
|
||||
if (logger) {
|
||||
this.logger = this._register(logger);
|
||||
} else {
|
||||
this.logger = this._register(loggerService.createLogger(environmentService.telemetryLogResource));
|
||||
this.logger.info('The below are logs for every telemetry event sent from VS Code once the log level is set to trace.');
|
||||
this.logger.info('===========================================================');
|
||||
}
|
||||
}
|
||||
|
||||
flush(): Promise<any> {
|
||||
@@ -27,7 +34,7 @@ export class TelemetryLogAppender extends Disposable implements ITelemetryAppend
|
||||
}
|
||||
|
||||
log(eventName: string, data: any): void {
|
||||
this.logger.trace(`telemetry/${eventName}`, validateTelemetryData(data));
|
||||
this.logger.trace(`${this.prefix}telemetry/${eventName}`, validateTelemetryData(data));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { localize } from 'vs/nls';
|
||||
import { escapeRegExpCharacters } from 'vs/base/common/strings';
|
||||
import { ITelemetryService, ITelemetryInfo, ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { optional } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationRegistry, Extensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { cloneAndChange, mixin } from 'vs/base/common/objects';
|
||||
import { escapeRegExpCharacters } from 'vs/base/common/strings';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { optional } from 'vs/platform/instantiation/common/instantiation';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { ITelemetryData, ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
|
||||
export interface ITelemetryServiceConfig {
|
||||
appender: ITelemetryAppender;
|
||||
@@ -220,12 +220,12 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
|
||||
'type': 'boolean',
|
||||
'markdownDescription':
|
||||
!product.privacyStatementUrl ?
|
||||
localize('telemetry.enableTelemetry', "Enable usage data and errors to be sent to a Microsoft online service.") :
|
||||
localize('telemetry.enableTelemetryMd', "Enable usage data and errors to be sent to a Microsoft online service. Read our privacy statement [here]({0}).", product.privacyStatementUrl),
|
||||
localize('telemetry.enableTelemetry', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.", product.nameLong) :
|
||||
localize('telemetry.enableTelemetryMd', "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.", product.nameLong, product.privacyStatementUrl),
|
||||
'default': true,
|
||||
'restricted': true,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'tags': ['usesOnlineServices']
|
||||
'tags': ['usesOnlineServices', 'telemetry']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Promises } from 'vs/base/common/async';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IConfigurationService, ConfigurationTarget, ConfigurationTargetToString } from 'vs/platform/configuration/common/configuration';
|
||||
import { ITelemetryService, ITelemetryInfo, ITelemetryData, ICustomEndpointTelemetryService, ITelemetryEndpoint } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ClassifiedEvent, StrictPropertyCheck, GDPRClassification } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { safeStringify } from 'vs/base/common/objects';
|
||||
import { isObject } from 'vs/base/common/types';
|
||||
import { Promises } from 'vs/base/common/async';
|
||||
import { ConfigurationTarget, ConfigurationTargetToString, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ClassifiedEvent, GDPRClassification, StrictPropertyCheck } from 'vs/platform/telemetry/common/gdprTypings';
|
||||
import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
export const NullTelemetryService = new class implements ITelemetryService {
|
||||
declare readonly _serviceBrand: undefined;
|
||||
@@ -61,7 +61,7 @@ export interface ITelemetryAppender {
|
||||
export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetryAppender {
|
||||
return {
|
||||
log: (e, d) => appenders.forEach(a => a.log(e, d)),
|
||||
flush: () => Promises.settled(appenders.map(a => a.flush()))
|
||||
flush: () => Promises.settled(appenders.map(a => a.flush())),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Client as TelemetryClient } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc';
|
||||
import { FileAccess } from 'vs/base/common/network';
|
||||
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { Client as TelemetryClient } from 'vs/base/parts/ipc/node/ipc.cp';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { ILoggerService } from 'vs/platform/log/common/log';
|
||||
import { ICustomEndpointTelemetryService, ITelemetryData, ITelemetryEndpoint, ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc';
|
||||
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
|
||||
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { combinedAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
|
||||
export class CustomEndpointTelemetryService implements ICustomEndpointTelemetryService {
|
||||
declare readonly _serviceBrand: undefined;
|
||||
@@ -17,7 +21,9 @@ export class CustomEndpointTelemetryService implements ICustomEndpointTelemetryS
|
||||
|
||||
constructor(
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@ILoggerService private readonly loggerService: ILoggerService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
) { }
|
||||
|
||||
private async getCustomTelemetryService(endpoint: ITelemetryEndpoint): Promise<ITelemetryService> {
|
||||
@@ -42,7 +48,10 @@ export class CustomEndpointTelemetryService implements ICustomEndpointTelemetryS
|
||||
);
|
||||
|
||||
const channel = client.getChannel('telemetryAppender');
|
||||
const appender = new TelemetryAppenderClient(channel);
|
||||
const appender = combinedAppender(
|
||||
new TelemetryAppenderClient(channel),
|
||||
new TelemetryLogAppender(this.loggerService, this.environmentService, `[${endpoint.id}] `),
|
||||
);
|
||||
|
||||
this.customTelemetryServices.set(endpoint.id, new TelemetryService({
|
||||
appender,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
|
||||
import { isPromiseCanceledError, onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors';
|
||||
import BaseErrorTelemetry from 'vs/platform/telemetry/common/errorTelemetry';
|
||||
|
||||
export default class ErrorTelemetry extends BaseErrorTelemetry {
|
||||
@@ -21,11 +21,13 @@ export default class ErrorTelemetry extends BaseErrorTelemetry {
|
||||
if (idx >= 0) {
|
||||
promise.catch(e => {
|
||||
unhandledPromises.splice(idx, 1);
|
||||
console.warn(`rejected promise not handled within 1 second: ${e}`);
|
||||
if (e.stack) {
|
||||
console.warn(`stack trace: ${e.stack}`);
|
||||
if (!isPromiseCanceledError(e)) {
|
||||
console.warn(`rejected promise not handled within 1 second: ${e}`);
|
||||
if (e.stack) {
|
||||
console.warn(`stack trace: ${e.stack}`);
|
||||
}
|
||||
onUnexpectedError(reason);
|
||||
}
|
||||
onUnexpectedError(reason);
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { Promises } from 'vs/base/node/pfs';
|
||||
|
||||
export async function buildTelemetryMessage(appRoot: string, extensionsPath?: string): Promise<string> {
|
||||
const mergedTelemetry = Object.create(null);
|
||||
|
||||
@@ -3,16 +3,16 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TelemetryService, ITelemetryServiceConfig } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry';
|
||||
import { NullAppender, ITelemetryAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import * as Errors from 'vs/base/common/errors';
|
||||
import * as sinon from 'sinon';
|
||||
import * as sinonTest from 'sinon-test';
|
||||
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import * as Errors from 'vs/base/common/errors';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
|
||||
import ErrorTelemetry from 'vs/platform/telemetry/browser/errorTelemetry';
|
||||
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { ITelemetryServiceConfig, TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { ITelemetryAppender, NullAppender } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
|
||||
const sinonTestFn = sinonTest(sinon);
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { LogLevel, ILoggerService, AbstractLogger, DEFAULT_LOG_LEVEL, ILogger } from 'vs/platform/log/common/log';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { AbstractLogger, DEFAULT_LOG_LEVEL, ILogger, ILoggerService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogAppender';
|
||||
|
||||
class TestTelemetryLogger extends AbstractLogger implements ILogger {
|
||||
|
||||
@@ -60,13 +60,19 @@ class TestTelemetryLogger extends AbstractLogger implements ILogger {
|
||||
class TestTelemetryLoggerService implements ILoggerService {
|
||||
_serviceBrand: undefined;
|
||||
|
||||
logger: TestTelemetryLogger;
|
||||
logger?: TestTelemetryLogger;
|
||||
|
||||
constructor(logLevel: LogLevel) {
|
||||
this.logger = new TestTelemetryLogger(logLevel);
|
||||
constructor(private readonly logLevel: LogLevel) { }
|
||||
|
||||
getLogger() {
|
||||
return this.logger;
|
||||
}
|
||||
|
||||
createLogger(): ILogger {
|
||||
createLogger() {
|
||||
if (!this.logger) {
|
||||
this.logger = new TestTelemetryLogger(this.logLevel);
|
||||
}
|
||||
|
||||
return this.logger;
|
||||
}
|
||||
}
|
||||
@@ -77,14 +83,14 @@ suite('TelemetryLogAdapter', () => {
|
||||
const testLoggerService = new TestTelemetryLoggerService(DEFAULT_LOG_LEVEL);
|
||||
const testObject = new TelemetryLogAppender(testLoggerService, new TestInstantiationService().stub(IEnvironmentService, {}));
|
||||
testObject.log('testEvent', { hello: 'world', isTrue: true, numberBetween1And3: 2 });
|
||||
assert.strictEqual(testLoggerService.logger.logs.length, 2);
|
||||
assert.strictEqual(testLoggerService.createLogger().logs.length, 2);
|
||||
});
|
||||
|
||||
test('Log Telemetry if log level is trace', async () => {
|
||||
const testLoggerService = new TestTelemetryLoggerService(LogLevel.Trace);
|
||||
const testObject = new TelemetryLogAppender(testLoggerService, new TestInstantiationService().stub(IEnvironmentService, {}));
|
||||
testObject.log('testEvent', { hello: 'world', isTrue: true, numberBetween1And3: 2 });
|
||||
assert.strictEqual(testLoggerService.logger.logs[2], 'telemetry/testEvent' + JSON.stringify([{
|
||||
assert.strictEqual(testLoggerService.createLogger().logs[2], 'telemetry/testEvent' + JSON.stringify([{
|
||||
properties: {
|
||||
hello: 'world',
|
||||
},
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { Contracts, TelemetryClient } from 'applicationinsights';
|
||||
import * as assert from 'assert';
|
||||
import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender';
|
||||
import { TelemetryClient, Contracts } from 'applicationinsights';
|
||||
|
||||
class AppInsightsMock extends TelemetryClient {
|
||||
public override config: any;
|
||||
|
||||
Reference in New Issue
Block a user