@@ -29,6 +29,7 @@ import { getGitpodVersion, isFeatureSupported } from './featureSupport';
29
29
import SSHConfiguration from './ssh/sshConfig' ;
30
30
import { isWindows } from './common/platform' ;
31
31
import { untildify } from './common/files' ;
32
+ import { ExperimentalSettings } from './experiments' ;
32
33
33
34
interface SSHConnectionParams {
34
35
workspaceId : string ;
@@ -118,7 +119,12 @@ export default class RemoteConnector extends Disposable {
118
119
119
120
private heartbeatManager : HeartbeatManager | undefined ;
120
121
121
- constructor ( private readonly context : vscode . ExtensionContext , private readonly logger : Log , private readonly telemetry : TelemetryReporter ) {
122
+ constructor (
123
+ private readonly context : vscode . ExtensionContext ,
124
+ private readonly experiments : ExperimentalSettings ,
125
+ private readonly logger : Log ,
126
+ private readonly telemetry : TelemetryReporter
127
+ ) {
122
128
super ( ) ;
123
129
124
130
if ( isGitpodRemoteWindow ( context ) ) {
@@ -770,11 +776,13 @@ export default class RemoteConnector extends Disposable {
770
776
771
777
this . logger . info ( 'Opening Gitpod workspace' , uri . toString ( ) ) ;
772
778
779
+ const userOverride = this . experiments . isUserOverride ( 'gitpod.remote.useLocalApp' ) ;
773
780
const forceUseLocalApp = vscode . workspace . getConfiguration ( 'gitpod' ) . get < boolean > ( 'remote.useLocalApp' ) ! ;
781
+ // const forceUseLocalApp = (await this.experiments.get<boolean>('gitpod.remote.useLocalApp', session.account.id))!;
774
782
let sshDestination : string | undefined ;
775
783
if ( ! forceUseLocalApp ) {
776
784
try {
777
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'connecting' , ...params , gitpodVersion : gitpodVersion . raw } ) ;
785
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'connecting' , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
778
786
779
787
const { destination, password } = await this . getWorkspaceSSHDestination ( session . accessToken , params ) ;
780
788
sshDestination = destination ;
@@ -783,9 +791,9 @@ export default class RemoteConnector extends Disposable {
783
791
await this . showSSHPasswordModal ( password , params ) ;
784
792
}
785
793
786
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'connected' , ...params , gitpodVersion : gitpodVersion . raw } ) ;
794
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'connected' , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
787
795
} catch ( e ) {
788
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'failed' , reason : e . toString ( ) , ...params , gitpodVersion : gitpodVersion . raw } ) ;
796
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'gateway' , status : 'failed' , reason : e . toString ( ) , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
789
797
if ( e instanceof NoSSHGatewayError ) {
790
798
this . logger . error ( 'No SSH gateway:' , e ) ;
791
799
vscode . window . showWarningMessage ( `${ e . host } does not support [direct SSH access](https://github.com/gitpod-io/gitpod/blob/main/install/installer/docs/workspace-ssh-access.md), connecting via the deprecated SSH tunnel over WebSocket.` ) ;
@@ -817,15 +825,15 @@ export default class RemoteConnector extends Disposable {
817
825
let localAppSSHConfigPath : string | undefined ;
818
826
if ( ! usingSSHGateway ) {
819
827
try {
820
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'connecting' , ...params , gitpodVersion : gitpodVersion . raw } ) ;
828
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'connecting' , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
821
829
822
830
const localAppDestData = await this . getWorkspaceLocalAppSSHDestination ( params ) ;
823
831
sshDestination = localAppDestData . localAppSSHDest ;
824
832
localAppSSHConfigPath = localAppDestData . localAppSSHConfigPath ;
825
833
826
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'connected' , ...params , gitpodVersion : gitpodVersion . raw } ) ;
834
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'connected' , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
827
835
} catch ( e ) {
828
- this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'failed' , reason : e . toString ( ) , ...params , gitpodVersion : gitpodVersion . raw } ) ;
836
+ this . telemetry . sendRawTelemetryEvent ( 'vscode_desktop_ssh' , { kind : 'local-app' , status : 'failed' , reason : e . toString ( ) , ...params , gitpodVersion : gitpodVersion . raw , userOverride } ) ;
829
837
this . logger . error ( `Failed to connect ${ params . workspaceId } Gitpod workspace:` , e ) ;
830
838
if ( e instanceof LocalAppError ) {
831
839
const seeLogs = 'See Logs' ;
0 commit comments