Skip to content

Commit 00dfd6a

Browse files
committed
Only use experiments for SaaS
1 parent bfd7061 commit 00dfd6a

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/experiments.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ export class ExperimentalSettings {
7070
return { key, defaultValue: values.defaultValue, globalValue: values.globalValue, experimentValue };
7171
}
7272

73-
isUserOverride(key: string): boolean {
74-
const config = vscode.workspace.getConfiguration('gitpod');
75-
const values = config.inspect(key.substring('gitpod.'.length));
76-
return values?.globalValue !== undefined;
77-
}
78-
7973
forceRefreshAsync(): Promise<void> {
8074
return this.configcatClient.forceRefreshAsync();
8175
}
@@ -88,3 +82,9 @@ export class ExperimentalSettings {
8882
this.configcatClient.dispose();
8983
}
9084
}
85+
86+
export function isUserOverrideSetting(key: string): boolean {
87+
const config = vscode.workspace.getConfiguration('gitpod');
88+
const values = config.inspect(key.substring('gitpod.'.length));
89+
return values?.globalValue !== undefined;
90+
}

src/remoteConnector.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { getGitpodVersion, isFeatureSupported } from './featureSupport';
2929
import SSHConfiguration from './ssh/sshConfig';
3030
import { isWindows } from './common/platform';
3131
import { untildify } from './common/files';
32-
import { ExperimentalSettings } from './experiments';
32+
import { ExperimentalSettings, isUserOverrideSetting } from './experiments';
3333

3434
interface SSHConnectionParams {
3535
workspaceId: string;
@@ -715,7 +715,7 @@ export default class RemoteConnector extends Disposable {
715715
return;
716716
}
717717
if (action === configureSSH) {
718-
const serviceUrl = new URL(sshParams.gitpodHost).toString().replace(/\/$/, '');
718+
const serviceUrl = getServiceURL(sshParams.gitpodHost);
719719
const externalUrl = sshKeysSupported ? `${serviceUrl}/keys` : 'https://www.gitpod.io/docs/configure/ssh#create-an-ssh-key';
720720
await vscode.env.openExternal(vscode.Uri.parse(externalUrl));
721721
throw new Error(`SSH password modal dialog, Configure SSH`);
@@ -776,9 +776,11 @@ export default class RemoteConnector extends Disposable {
776776

777777
this.logger.info('Opening Gitpod workspace', uri.toString());
778778

779-
const userOverride = this.experiments.isUserOverride('gitpod.remote.useLocalApp');
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))!;
779+
// Only use experiment for SaaS
780+
const forceUseLocalApp = getServiceURL(params.gitpodHost) === 'https://gitpod.io'
781+
? (await this.experiments.get<boolean>('gitpod.remote.useLocalApp', session.account.id))!
782+
: vscode.workspace.getConfiguration('gitpod').get<boolean>('remote.useLocalApp')!;
783+
const userOverride = isUserOverrideSetting('gitpod.remote.useLocalApp');
782784
let sshDestination: string | undefined;
783785
if (!forceUseLocalApp) {
784786
try {
@@ -983,3 +985,7 @@ async function cancelGitpodRemoteHeartbeat() {
983985
}
984986
return result;
985987
}
988+
989+
function getServiceURL(gitpodHost: string): string {
990+
return new URL(gitpodHost).toString().replace(/\/$/, '');
991+
}

0 commit comments

Comments
 (0)