mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Workspace trust - emit telemetry if workspace trust is disabled (#126372)
* Emit telemetry if workspace trust is disabled * use explicit event Co-authored-by: SteVen Batten <steven.m.batten@outlook.com>
This commit is contained in:
@@ -46,6 +46,7 @@ import { IBannerItem, IBannerService } from 'vs/workbench/services/banner/browse
|
||||
import { isVirtualWorkspace } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { LIST_WORKSPACE_UNSUPPORTED_EXTENSIONS_COMMAND_ID } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { WORKSPACE_TRUST_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
|
||||
@@ -696,6 +697,7 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
|
||||
*/
|
||||
class WorkspaceTrustTelemetryContribution extends Disposable implements IWorkbenchContribution {
|
||||
constructor(
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
@@ -712,6 +714,19 @@ class WorkspaceTrustTelemetryContribution extends Disposable implements IWorkben
|
||||
|
||||
private logInitialWorkspaceTrustInfo(): void {
|
||||
if (!this.workspaceTrustManagementService.workspaceTrustEnabled) {
|
||||
const disabledByCliFlag = this.environmentService.disableWorkspaceTrust;
|
||||
|
||||
type WorkspaceTrustDisabledEventClassification = {
|
||||
reason: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
};
|
||||
|
||||
type WorkspaceTrustDisabledEvent = {
|
||||
reason: 'setting' | 'cli',
|
||||
};
|
||||
|
||||
this.telemetryService.publicLog2<WorkspaceTrustDisabledEvent, WorkspaceTrustDisabledEventClassification>('workspaceTrustDisabled', {
|
||||
reason: disabledByCliFlag ? 'cli' : 'setting'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user