Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat setup - log when workspace trust is not given #237518

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/vs/workbench/contrib/chat/browser/chatSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ type InstallChatClassification = {
signUpErrorCode: { classification: 'SystemMetaData'; purpose: 'FeatureInsight'; comment: 'The error code in case of an error signing up.' };
};
type InstallChatEvent = {
installResult: 'installed' | 'cancelled' | 'failedInstall' | 'failedNotSignedIn' | 'failedSignUp';
installResult: 'installed' | 'cancelled' | 'failedInstall' | 'failedNotSignedIn' | 'failedSignUp' | 'failedNotTrusted';
signedIn: boolean;
signUpErrorCode: number | undefined;
};
Expand Down Expand Up @@ -779,6 +779,7 @@ class ChatSetupController extends Disposable {
this.setStep(ChatSetupStep.SigningIn);
const result = await this.signIn();
if (!result.session) {
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', signedIn: false, signUpErrorCode: undefined });
return; // user cancelled
}

Expand All @@ -789,6 +790,7 @@ class ChatSetupController extends Disposable {
if (!session) {
session = (await this.authenticationService.getSessions(defaultChat.providerId)).at(0);
if (!session) {
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', signedIn: false, signUpErrorCode: undefined });
return; // unexpected
}
}
Expand All @@ -797,6 +799,7 @@ class ChatSetupController extends Disposable {
message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.")
});
if (!trusted) {
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotTrusted', signedIn: true, signUpErrorCode: undefined });
return;
}

Expand Down Expand Up @@ -833,10 +836,6 @@ class ChatSetupController extends Disposable {
this.logService.error(`[chat setup] signIn: error ${error}`);
}

if (!session) {
this.telemetryService.publicLog2<InstallChatEvent, InstallChatClassification>('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', signedIn: false, signUpErrorCode: undefined });
}

return { session, entitlement };
}

Expand Down
Loading