Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3 (#6516)

* Merge from vscode 2cfc8172e533e50c90e6a3152f6bfb1f82f963f3

* fix tests
This commit is contained in:
Anthony Dresser
2019-07-28 15:15:24 -07:00
committed by GitHub
parent aacf1e7f1c
commit 1d56a17f32
292 changed files with 19784 additions and 1873 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export interface IPropertyData {
classification: 'SystemMetaData' | 'CallstackOrException' | 'CustomerContent' | 'PublicNonPersonalData';
classification: 'SystemMetaData' | 'CallstackOrException' | 'CustomerContent' | 'PublicNonPersonalData' | 'EndUserPseudonymizedInformation';
purpose: 'PerformanceAndHealth' | 'FeatureInsight' | 'BusinessInsight';
endpoint?: string;
isMeasurement?: boolean;

View File

@@ -69,20 +69,16 @@ export class TelemetryService implements ITelemetryService {
this._commonProperties.then(values => {
const isHashedId = /^[a-f0-9]+$/i.test(values['common.machineId']);
/* __GDPR__
"machineIdFallback" : {
"usingFallbackGuid" : { "classification": "SystemMetaData", "purpose": "BusinessInsight", "isMeasurement": true }
}
*/
this.publicLog('machineIdFallback', { usingFallbackGuid: !isHashedId });
type MachineIdFallbackClassification = {
usingFallbackGuid: { classification: 'SystemMetaData', purpose: 'BusinessInsight', isMeasurement: true };
};
this.publicLog2<{ usingFallbackGuid: boolean }, MachineIdFallbackClassification>('machineIdFallback', { usingFallbackGuid: !isHashedId });
if (config.trueMachineId) {
/* __GDPR__
"machineIdDisambiguation" : {
"correctedMachineId" : { "endPoint": "MacAddressHash", "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight" }
}
*/
this.publicLog('machineIdDisambiguation', { correctedMachineId: config.trueMachineId });
type MachineIdDisambiguationClassification = {
correctedMachineId: { endPoint: 'MacAddressHash', classification: 'EndUserPseudonymizedInformation', purpose: 'FeatureInsight' };
};
this.publicLog2<{ correctedMachineId: string }, MachineIdDisambiguationClassification>('machineIdDisambiguation', { correctedMachineId: config.trueMachineId });
}
});
}

View File

@@ -33,17 +33,17 @@ export const NullTelemetryService = new class implements ITelemetryService {
export interface ITelemetryAppender {
log(eventName: string, data: any): void;
dispose(): Promise<any> | undefined;
flush(): Promise<any>;
}
export function combinedAppender(...appenders: ITelemetryAppender[]): ITelemetryAppender {
return {
log: (e, d) => appenders.forEach(a => a.log(e, d)),
dispose: () => Promise.all(appenders.map(a => a.dispose()))
flush: () => Promise.all(appenders.map(a => a.flush()))
};
}
export const NullAppender: ITelemetryAppender = { log: () => null, dispose: () => Promise.resolve(null) };
export const NullAppender: ITelemetryAppender = { log: () => null, flush: () => Promise.resolve(null) };
export class LogAppender implements ITelemetryAppender {
@@ -51,7 +51,7 @@ export class LogAppender implements ITelemetryAppender {
private commonPropertiesRegex = /^sessionID$|^version$|^timestamp$|^commitHash$|^common\./;
constructor(@ILogService private readonly _logService: ILogService) { }
dispose(): Promise<any> {
flush(): Promise<any> {
return Promise.resolve(undefined);
}

View File

@@ -73,7 +73,7 @@ export class AppInsightsAppender implements ITelemetryAppender {
});
}
dispose(): Promise<any> | undefined {
flush(): Promise<any> | undefined {
if (this._aiClient) {
return new Promise(resolve => {
this._aiClient!.flush({

View File

@@ -37,7 +37,7 @@ export class TelemetryAppenderClient implements ITelemetryAppender {
return Promise.resolve(null);
}
dispose(): any {
flush(): any {
// TODO
}
}

View File

@@ -84,7 +84,7 @@ suite('AIAdapter', () => {
});
teardown(() => {
adapter.dispose();
adapter.flush();
});
test('Simple event', () => {

View File

@@ -30,7 +30,7 @@ class TestTelemetryAppender implements ITelemetryAppender {
return this.events.length;
}
public dispose(): Promise<any> {
public flush(): Promise<any> {
this.isDisposed = true;
return Promise.resolve(null);
}