Skip to content

Commit 3e1afb7

Browse files
committed
Cleanup old sync extension logic
1 parent 203d291 commit 3e1afb7

File tree

7 files changed

+67
-361
lines changed

7 files changed

+67
-361
lines changed

package.json

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"url": "https://github.com/gitpod-io/gitpod/issues"
1515
},
1616
"engines": {
17-
"vscode": "^1.75.0"
17+
"vscode": "^1.81.0"
1818
},
1919
"categories": [
2020
"Other"
@@ -33,8 +33,6 @@
3333
},
3434
"activationEvents": [
3535
"onResolveRemoteAuthority:ssh-remote",
36-
"onCommand:gitpod.syncProvider.add",
37-
"onCommand:gitpod.syncProvider.remove",
3836
"onCommand:gitpod.exportLogs",
3937
"onCommand:gitpod.api.autoTunnel",
4038
"onCommand:gitpod.installLocalExtensions",
@@ -76,31 +74,9 @@
7674
"scope": "application"
7775
}
7876
}
79-
},
80-
{
81-
"title": "Settings sync",
82-
"properties": {
83-
"configurationSync.store": {
84-
"type": "object",
85-
"description": "Settings Sync Provider configuration.",
86-
"scope": "application"
87-
}
88-
}
8977
}
9078
],
9179
"commands": [
92-
{
93-
"command": "gitpod.syncProvider.add",
94-
"category": "Settings Sync",
95-
"enablement": "!gitpod.addedSyncProvider",
96-
"title": "Enable Sign In with Gitpod"
97-
},
98-
{
99-
"command": "gitpod.syncProvider.remove",
100-
"category": "Settings Sync",
101-
"enablement": "gitpod.addedSyncProvider",
102-
"title": "Disable Sign In with Gitpod"
103-
},
10480
{
10581
"command": "gitpod.exportLogs",
10682
"category": "Gitpod",

src/commands/extensions.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Gitpod. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { Command } from '../commandManager';
7+
import { IRemoteService } from '../services/remoteService';
8+
9+
export class InstallLocalExtensionsOnRemote implements Command {
10+
readonly id = 'gitpod.installLocalExtensions';
11+
12+
constructor(private readonly remoteService: IRemoteService) { }
13+
14+
async execute() {
15+
await this.remoteService.initializeRemoteExtensions();
16+
}
17+
}

src/extension.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { ExperimentalSettings } from './experiments';
1111
import GitpodServer from './authentication/gitpodServer';
1212
import { NotificationService } from './services/notificationService';
1313
import { RemoteConnector } from './remoteConnector';
14-
import { SettingsSync } from './settingsSync';
1514
import { TelemetryService } from './services/telemetryService';
1615
import { RemoteSession } from './remoteSession';
1716
import { SSHConnectionParams, getGitpodRemoteWindowConnectionInfo } from './remote';
@@ -24,6 +23,7 @@ import { Configuration } from './configuration';
2423
import { RemoteService } from './services/remoteService';
2524
import { WorkspacesExplorerView } from './workspacesExplorerView';
2625
import { WorkspaceView } from './workspaceView';
26+
import { InstallLocalExtensionsOnRemote } from './commands/extensions';
2727

2828
// connect-web uses fetch api, so we need to polyfill it
2929
if (!global.fetch) {
@@ -89,9 +89,6 @@ export async function activate(context: vscode.ExtensionContext) {
8989
const experiments = new ExperimentalSettings(packageJSON.configcatKey, packageJSON.version, context, sessionService, hostService, logger);
9090
context.subscriptions.push(experiments);
9191

92-
const settingsSync = new SettingsSync(commandManager, logger, telemetryService, notificationService);
93-
context.subscriptions.push(settingsSync);
94-
9592
const remoteConnector = new RemoteConnector(context, sessionService, hostService, experiments, logger, telemetryService, notificationService, remoteService);
9693
context.subscriptions.push(remoteConnector);
9794

@@ -119,6 +116,7 @@ export async function activate(context: vscode.ExtensionContext) {
119116

120117
// Register global commands
121118
commandManager.register(new SignInCommand(sessionService));
119+
commandManager.register(new InstallLocalExtensionsOnRemote(remoteService));
122120
commandManager.register(new ExportLogsCommand(context.logUri, notificationService, telemetryService, logger, hostService));
123121

124122
if (!context.globalState.get<boolean>(FIRST_INSTALL_KEY, false)) {

src/profileExtensions.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Gitpod. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
// From https://github.com/microsoft/vscode/blob/5413247e57fb7e3d29cd36f08266005fe72bbde4/src/vs/platform/extensionManagement/common/extensionsProfileScannerService.ts#L24-L30
7+
8+
export interface IStoredProfileExtension {
9+
identifier: IExtensionIdentifier;
10+
location: UriComponents | string;
11+
relativeLocation: string | undefined;
12+
version: string;
13+
metadata?: Metadata;
14+
}
15+
16+
interface IExtensionIdentifier {
17+
id: string;
18+
uuid?: string;
19+
}
20+
21+
interface UriComponents {
22+
scheme: string;
23+
authority?: string;
24+
path?: string;
25+
query?: string;
26+
fragment?: string;
27+
}
28+
29+
interface IGalleryMetadata {
30+
id: string;
31+
publisherId: string;
32+
publisherDisplayName: string;
33+
isPreReleaseVersion: boolean;
34+
targetPlatform?: string;
35+
}
36+
37+
type Metadata = Partial<IGalleryMetadata & {
38+
isApplicationScoped: boolean;
39+
isMachineScoped: boolean;
40+
isBuiltin: boolean;
41+
isSystem: boolean;
42+
updated: boolean;
43+
preRelease: boolean;
44+
installedTimestamp: number;
45+
pinned: boolean;
46+
}>;

src/remoteSession.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ export class RemoteSession extends Disposable {
9898
this.heartbeatManager = new HeartbeatManager(this.connectionInfo, this.workspaceState, this.sessionService, this.logService, this.telemetryService);
9999

100100
this.remoteService.initializeRemoteExtensions();
101-
this._register(vscode.commands.registerCommand('gitpod.installLocalExtensions', () => {
102-
this.remoteService.initializeRemoteExtensions();
103-
}));
104101

105102
vscode.commands.executeCommand('setContext', 'gitpod.inWorkspace', true);
106103
} catch (e) {

src/services/remoteService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { utils as sshUtils } from 'ssh2';
3030
import { INotificationService } from './notificationService';
3131
import { getOpenSSHVersion } from '../ssh/nativeSSH';
3232
import { retry } from '../common/async';
33-
import { IStoredProfileExtension } from '../settingsSync';
33+
import { IStoredProfileExtension } from '../profileExtensions';
3434

3535
export interface IRemoteService {
3636
flow?: UserFlowTelemetryProperties;

0 commit comments

Comments
 (0)