mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Merge from vscode 5b9869eb02fa4c96205a74d05cad9164dfd06d60 (#5607)
This commit is contained in:
@@ -10,8 +10,9 @@ import { readFile } from 'vs/base/node/pfs';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import product from 'vs/platform/product/node/product';
|
||||
const productObject = product;
|
||||
|
||||
export function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string): Promise<{ [name: string]: string | undefined; }> {
|
||||
export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | undefined; }> {
|
||||
const result: { [name: string]: string | undefined; } = Object.create(null);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -36,8 +37,8 @@ export function resolveCommonProperties(commit: string | undefined, version: str
|
||||
result['common.nodeArch'] = process.arch;
|
||||
// __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.product'] = product.nameShort || 'desktop';
|
||||
result['common.application.name'] = product.nameLong;
|
||||
result['common.product'] = productObject.nameShort || 'desktop';
|
||||
result['common.application.name'] = productObject.nameLong;
|
||||
|
||||
// dynamic properties which value differs on each call
|
||||
let seq = 0;
|
||||
@@ -65,13 +66,14 @@ export function resolveCommonProperties(commit: string | undefined, version: str
|
||||
result['common.snap'] = 'true';
|
||||
}
|
||||
|
||||
return readFile(installSourcePath, 'utf8').then(contents => {
|
||||
try {
|
||||
const contents = await readFile(installSourcePath, 'utf8');
|
||||
|
||||
// __GDPR__COMMON__ "common.source" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
result['common.source'] = contents.slice(0, 30);
|
||||
} catch (error) {
|
||||
// ignore error
|
||||
}
|
||||
|
||||
return result;
|
||||
}, error => {
|
||||
return result;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3,20 +3,18 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import product from 'vs/platform/product/node/product';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export function addGAParameters(telemetryService: ITelemetryService, environmentService: IEnvironmentService, uri: URI, origin: string, experiment = '1'): Promise<URI> {
|
||||
export async function addGAParameters(telemetryService: ITelemetryService, environmentService: IEnvironmentService, uri: URI, origin: string, experiment = '1'): Promise<URI> {
|
||||
if (environmentService.isBuilt && !environmentService.isExtensionDevelopment && !environmentService.args['disable-telemetry'] && !!product.enableTelemetry) {
|
||||
if (uri.scheme === 'https' && uri.authority === 'code.visualstudio.com') {
|
||||
return telemetryService.getTelemetryInfo()
|
||||
.then(info => {
|
||||
return uri.with({ query: `${uri.query ? uri.query + '&' : ''}utm_source=VsCode&utm_medium=${encodeURIComponent(origin)}&utm_campaign=${encodeURIComponent(info.instanceId)}&utm_content=${encodeURIComponent(experiment)}` });
|
||||
});
|
||||
const info = await telemetryService.getTelemetryInfo();
|
||||
|
||||
return uri.with({ query: `${uri.query ? uri.query + '&' : ''}utm_source=VsCode&utm_medium=${encodeURIComponent(origin)}&utm_campaign=${encodeURIComponent(info.instanceId)}&utm_content=${encodeURIComponent(experiment)}` });
|
||||
}
|
||||
}
|
||||
return Promise.resolve(uri);
|
||||
return uri;
|
||||
}
|
||||
|
||||
@@ -14,35 +14,38 @@ export const lastSessionDateStorageKey = 'telemetry.lastSessionDate';
|
||||
// {{ SQL CARBON EDIT }}
|
||||
import product from 'vs/platform/product/node/product';
|
||||
|
||||
export function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string): Promise<{ [name: string]: string | undefined }> {
|
||||
return resolveCommonProperties(commit, version, machineId, installSourcePath).then(result => {
|
||||
const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!;
|
||||
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||
const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||
export async function resolveWorkbenchCommonProperties(storageService: IStorageService, commit: string | undefined, version: string | undefined, machineId: string, installSourcePath: string): Promise<{ [name: string]: string | undefined }> {
|
||||
const result = await resolveCommonProperties(commit, version, machineId, installSourcePath);
|
||||
const instanceId = storageService.get(instanceStorageKey, StorageScope.GLOBAL)!;
|
||||
const firstSessionDate = storageService.get(firstSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||
const lastSessionDate = storageService.get(lastSessionDateStorageKey, StorageScope.GLOBAL)!;
|
||||
|
||||
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
result['common.version.shell'] = process.versions && process.versions['electron'];
|
||||
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.application.name'] = product.nameLong;
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.userId'] = '';
|
||||
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
// result['common.version.shell'] = process.versions && process.versions['electron'];
|
||||
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
// result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
||||
// __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.firstSessionDate'] = firstSessionDate;
|
||||
// __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.lastSessionDate'] = lastSessionDate || '';
|
||||
// __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||
// __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.instanceId'] = instanceId;
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// // __GDPR__COMMON__ "common.firstSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.firstSessionDate'] = firstSessionDate;
|
||||
// // __GDPR__COMMON__ "common.lastSessionDate" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.lastSessionDate'] = lastSessionDate || '';
|
||||
// // __GDPR__COMMON__ "common.isNewSession" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.isNewSession'] = !lastSessionDate ? '1' : '0';
|
||||
// // __GDPR__COMMON__ "common.instanceId" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
// result['common.instanceId'] = instanceId;
|
||||
// __GDPR__COMMON__ "common.version.shell" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
result['common.version.shell'] = process.versions && process.versions['electron'];
|
||||
// __GDPR__COMMON__ "common.version.renderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
|
||||
result['common.version.renderer'] = process.versions && process.versions['chrome'];
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.application.name'] = product.nameLong;
|
||||
// {{SQL CARBON EDIT}}
|
||||
result['common.userId'] = '';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
setUsageDates(storageService);
|
||||
return result;
|
||||
});
|
||||
// {{SQL CARBON EDIT}}
|
||||
setUsageDates(storageService);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
|
||||
Reference in New Issue
Block a user