Skip to content

Commit 7b8b4a3

Browse files
akosyakovjeanp413
authored andcommitted
disable desktop support for stable
1 parent 7a0884f commit 7b8b4a3

File tree

8 files changed

+60
-54
lines changed

8 files changed

+60
-54
lines changed

extensions/gitpod-remote/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,17 @@
103103
{
104104
"command": "gitpod.openInStable",
105105
"title": "%openInStable%",
106-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
106+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
107107
},
108108
{
109109
"command": "gitpod.openInInsiders",
110110
"title": "%openInInsiders%",
111-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
111+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
112112
},
113113
{
114114
"command": "gitpod.openInBrowser",
115115
"title": "%openInBrowser%",
116-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop'"
116+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop' && gitpod.ideAlias == 'code-latest'"
117117
}
118118
],
119119
"menus": {
@@ -196,17 +196,17 @@
196196
{
197197
"command": "gitpod.openInStable",
198198
"group": "remote_00_gitpod_navigation@900",
199-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
199+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
200200
},
201201
{
202202
"command": "gitpod.openInInsiders",
203203
"group": "remote_00_gitpod_navigation@1000",
204-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
204+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
205205
},
206206
{
207207
"command": "gitpod.openInBrowser",
208208
"group": "remote_00_gitpod_navigation@1000",
209-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop'"
209+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop' && gitpod.ideAlias == 'code-latest'"
210210
}
211211
]
212212
}
@@ -221,4 +221,4 @@
221221
"gitpod-shared": "0.0.1",
222222
"vscode-nls": "^5.0.0"
223223
}
224-
}
224+
}

extensions/gitpod-remote/src/extension.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ export function registerCLI(context: GitpodExtensionContext): void {
7979
return;
8080
}
8181

82-
// TODO(ak) fetch ide port from supervisor
83-
const idePort = Number(process.env.GITPOD_THEIA_PORT);
8482
async function updateIpcHookCli(): Promise<void> {
8583
try {
8684
await new Promise<void>((resolve, reject) => {
8785
const req = http.request({
8886
hostname: 'localhost',
89-
port: idePort,
87+
port: context.info.getIdePort(),
9088
protocol: 'http:',
9189
path: '/cli',
9290
method: vscode.window.state.focused ? 'PUT' : 'DELETE'

extensions/gitpod-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@gitpod/gitpod-protocol": "main",
19-
"@gitpod/supervisor-api-grpc": "jeanp413-your-workspace-is-currently-5313",
19+
"@gitpod/supervisor-api-grpc": "ak-no-code-desktop-in-stable",
2020
"bufferutil": "^4.0.1",
2121
"reconnecting-websocket": "^4.4.0",
2222
"utf-8-validate": "^5.0.2",

extensions/gitpod-shared/scripts/inflate.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ const commands = [
106106
{
107107
'command': 'gitpod.openInStable',
108108
'title': '%openInStable%',
109-
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\''
109+
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\' && gitpod.ideAlias == \'code-latest\''
110110
},
111111
{
112112
'command': 'gitpod.openInInsiders',
113113
'title': '%openInInsiders%',
114-
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\''
114+
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\' && gitpod.ideAlias == \'code-latest\''
115115
},
116116
{
117117
'command': 'gitpod.openInBrowser',
118118
'title': '%openInBrowser%',
119-
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'desktop\''
119+
'enablement': 'gitpod.inWorkspace == true && gitpod.UIKind == \'desktop\' && gitpod.ideAlias == \'code-latest\''
120120
}
121121
];
122122

@@ -199,17 +199,17 @@ const remoteMenus = [
199199
{
200200
'command': 'gitpod.openInStable',
201201
'group': 'remote_00_gitpod_navigation@900',
202-
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\''
202+
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\' && gitpod.ideAlias == \'code-latest\''
203203
},
204204
{
205205
'command': 'gitpod.openInInsiders',
206206
'group': 'remote_00_gitpod_navigation@1000',
207-
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\''
207+
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'web\' && gitpod.ideAlias == \'code-latest\''
208208
},
209209
{
210210
'command': 'gitpod.openInBrowser',
211211
'group': 'remote_00_gitpod_navigation@1000',
212-
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'desktop\''
212+
'when': 'gitpod.inWorkspace == true && gitpod.UIKind == \'desktop\' && gitpod.ideAlias == \'code-latest\''
213213
}
214214
];
215215

extensions/gitpod-shared/src/extension.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ export async function createContext(context: vscode.ExtensionContext): Promise<G
1717
return undefined;
1818
}
1919
vscode.commands.executeCommand('setContext', 'gitpod.inWorkspace', true);
20+
21+
vscode.commands.executeCommand('setContext', 'gitpod.ideAlias', gitpodContext.info.getIdeAlias());
22+
if (vscode.env.uiKind === vscode.UIKind.Web) {
23+
vscode.commands.executeCommand('setContext', 'gitpod.UIKind', 'web');
24+
} else if (vscode.env.uiKind === vscode.UIKind.Desktop) {
25+
vscode.commands.executeCommand('setContext', 'gitpod.UIKind', 'desktop');
26+
}
27+
2028
registerUsageAnalytics(gitpodContext);
2129
registerWorkspaceCommands(gitpodContext);
2230
registerWorkspaceSharing(gitpodContext);

extensions/gitpod-shared/src/features.ts

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -321,31 +321,29 @@ export async function registerWorkspaceCommands(context: GitpodExtensionContext)
321321
vscode.env.openExternal(vscode.Uri.parse('https://github.com/gitpod-io/gitpod/issues/new/choose'))
322322
));
323323

324-
if (vscode.env.uiKind === vscode.UIKind.Web) {
325-
vscode.commands.executeCommand('setContext', 'gitpod.UIKind', 'web');
326-
function openDesktop(scheme: 'vscode' | 'vscode-insiders'): void {
327-
const uri = vscode.workspace.workspaceFile || vscode.workspace.workspaceFolders?.[0]?.uri;
328-
vscode.env.openExternal(vscode.Uri.from({
329-
scheme,
330-
authority: 'gitpod.gitpod-desktop',
331-
path: uri?.path || context.info.getWorkspaceLocationFile() || context.info.getWorkspaceLocationFolder() || context.info.getCheckoutLocation(),
332-
query: JSON.stringify({
333-
instanceId: context.info.getInstanceId(),
334-
workspaceId: context.info.getWorkspaceId(),
335-
gitpodHost: context.info.getGitpodHost()
336-
})
337-
}));
324+
if (context.info.getIdeAlias() === 'code-latest') {
325+
if (vscode.env.uiKind === vscode.UIKind.Web) {
326+
function openDesktop(scheme: 'vscode' | 'vscode-insiders'): void {
327+
const uri = vscode.workspace.workspaceFile || vscode.workspace.workspaceFolders?.[0]?.uri;
328+
vscode.env.openExternal(vscode.Uri.from({
329+
scheme,
330+
authority: 'gitpod.gitpod-desktop',
331+
path: uri?.path || context.info.getWorkspaceLocationFile() || context.info.getWorkspaceLocationFolder() || context.info.getCheckoutLocation(),
332+
query: JSON.stringify({
333+
instanceId: context.info.getInstanceId(),
334+
workspaceId: context.info.getWorkspaceId(),
335+
gitpodHost: context.info.getGitpodHost()
336+
})
337+
}));
338+
}
339+
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInStable', () => openDesktop('vscode')));
340+
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInInsiders', () => openDesktop('vscode-insiders')));
341+
}
342+
if (vscode.env.uiKind === vscode.UIKind.Desktop) {
343+
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInBrowser', () =>
344+
vscode.env.openExternal(vscode.Uri.parse(context.info.getWorkspaceUrl()))
345+
));
338346
}
339-
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInStable', () => openDesktop('vscode')));
340-
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInInsiders', () => openDesktop('vscode-insiders')));
341-
}
342-
// TODO(ak) fetch from supervisor info endpoint
343-
const workspaceUrl = process.env.GITPOD_WORKSPACE_URL;
344-
if (vscode.env.uiKind === vscode.UIKind.Desktop && workspaceUrl) {
345-
vscode.commands.executeCommand('setContext', 'gitpod.UIKind', 'desktop');
346-
context.subscriptions.push(vscode.commands.registerCommand('gitpod.openInBrowser', () =>
347-
vscode.env.openExternal(vscode.Uri.parse(workspaceUrl))
348-
));
349347
}
350348

351349
const communityStatusBarItem = vscode.window.createStatusBarItem('gitpod.community', vscode.StatusBarAlignment.Right, -100);

extensions/gitpod-web/package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@
101101
{
102102
"command": "gitpod.openInStable",
103103
"title": "%openInStable%",
104-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
104+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
105105
},
106106
{
107107
"command": "gitpod.openInInsiders",
108108
"title": "%openInInsiders%",
109-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
109+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
110110
},
111111
{
112112
"command": "gitpod.openInBrowser",
113113
"title": "%openInBrowser%",
114-
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop'"
114+
"enablement": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop' && gitpod.ideAlias == 'code-latest'"
115115
},
116116
{
117117
"command": "gitpod.ports.openBrowser",
@@ -193,11 +193,13 @@
193193
},
194194
{
195195
"command": "gitpod.openInStable",
196-
"group": "gitpod@60"
196+
"group": "gitpod@60",
197+
"when": "gitpod.ideAlias == 'code-latest'"
197198
},
198199
{
199200
"command": "gitpod.openInInsiders",
200-
"group": "gitpod@70"
201+
"group": "gitpod@70",
202+
"when": "gitpod.ideAlias == 'code-latest'"
201203
}
202204
],
203205
"accounts/context": [
@@ -394,17 +396,17 @@
394396
{
395397
"command": "gitpod.openInStable",
396398
"group": "remote_00_gitpod_navigation@900",
397-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
399+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
398400
},
399401
{
400402
"command": "gitpod.openInInsiders",
401403
"group": "remote_00_gitpod_navigation@1000",
402-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web'"
404+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'web' && gitpod.ideAlias == 'code-latest'"
403405
},
404406
{
405407
"command": "gitpod.openInBrowser",
406408
"group": "remote_00_gitpod_navigation@1000",
407-
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop'"
409+
"when": "gitpod.inWorkspace == true && gitpod.UIKind == 'desktop' && gitpod.ideAlias == 'code-latest'"
408410
}
409411
]
410412
},
@@ -441,4 +443,4 @@
441443
"vscode-jsonrpc": "^5.0.1",
442444
"vscode-nls": "^5.0.0"
443445
}
444-
}
446+
}

extensions/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"@improbable-eng/grpc-web" "0.14.0"
3232
google-protobuf "^3.17.0"
3333

34-
"@gitpod/supervisor-api-grpc@jeanp413-your-workspace-is-currently-5313":
35-
version "0.1.5-jeanp413-your-workspace-is-currently-5313.0"
36-
resolved "https://registry.yarnpkg.com/@gitpod/supervisor-api-grpc/-/supervisor-api-grpc-0.1.5-jeanp413-your-workspace-is-currently-5313.0.tgz#dae4e6c93d324f8df72d34320c6a9281c82a2c86"
37-
integrity sha512-/4Y5bQ1braB4yxD5C5m9+2kdpqj5xwP0d9eUXqZ5i6S16uV1Qr0jqinKDOFRo0XT3/jdrvZyhU9THmOGNHzVGQ==
34+
"@gitpod/supervisor-api-grpc@ak-no-code-desktop-in-stable":
35+
version "0.1.5-ak-no-code-desktop-in-stable.2"
36+
resolved "https://registry.yarnpkg.com/@gitpod/supervisor-api-grpc/-/supervisor-api-grpc-0.1.5-ak-no-code-desktop-in-stable.2.tgz#b71f3792cee310e5eb00111a169be17253e0dacd"
37+
integrity sha512-wHd/F4dI75MtNH8DjZlUZ+SUIJGyXjq6VvpQXqUGyWRPKQelgPrOx4nbCfNzsRIsAgsJvoAFU8rg7O4tr4vYtg==
3838
dependencies:
3939
"@grpc/grpc-js" "^1.3.6"
4040
google-protobuf "^3.17.3"

0 commit comments

Comments
 (0)