Skip to content

Commit 6a52dbf

Browse files
felladrinroboquat
authored andcommitted
Avoid displaying prebuild-related workspaces in the workspaces list from JetBrains Gateway
1 parent b60946e commit 6a52dbf

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

components/gitpod-protocol/java/src/main/java/io/gitpod/gitpodprotocol/api/entities/Workspace.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public class Workspace {
1414

1515
private String creationTime;
1616

17+
private String type;
18+
1719
public String getId() {
1820
return id;
1921
}
@@ -45,4 +47,12 @@ public String getCreationTime() {
4547
public void setCreationTime(String creationTime) {
4648
this.creationTime = creationTime;
4749
}
50+
51+
public WorkspaceType getType() {
52+
return WorkspaceType.valueOf(type);
53+
}
54+
55+
public void setType(WorkspaceType type) {
56+
this.type = type.toString();
57+
}
4858
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License-AGPL.txt in the project root for license information.
4+
5+
package io.gitpod.gitpodprotocol.api.entities;
6+
7+
public enum WorkspaceType {
8+
regular,
9+
prebuild
10+
}

components/ide/jetbrains/gateway-plugin/src/main/kotlin/io/gitpod/jetbrains/gateway/GitpodWorkspacesView.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.jetbrains.rd.util.lifetime.isAlive
2828
import com.jetbrains.rd.util.lifetime.isNotAlive
2929
import io.gitpod.gitpodprotocol.api.entities.GetWorkspacesOptions
3030
import io.gitpod.gitpodprotocol.api.entities.WorkspaceInstance
31+
import io.gitpod.gitpodprotocol.api.entities.WorkspaceType
3132
import io.gitpod.jetbrains.auth.GitpodAuthService
3233
import io.gitpod.jetbrains.icons.GitpodIcons
3334
import kotlinx.coroutines.GlobalScope
@@ -247,7 +248,7 @@ class GitpodWorkspacesView(
247248
}
248249
}
249250
for (info in sortedInfos) {
250-
if (info.latestInstance == null) {
251+
if (info.latestInstance == null || info.workspace.type != WorkspaceType.regular) {
251252
continue
252253
}
253254
indent {
@@ -341,7 +342,9 @@ class GitpodWorkspacesView(
341342
thisLogger().error("$gitpodHost: ${update.workspaceId}: failed to sync", t)
342343
continue
343344
}
344-
workspacesMap[update.workspaceId] = info
345+
if (info.workspace.type == WorkspaceType.regular) {
346+
workspacesMap[update.workspaceId] = info
347+
}
345348
} else if (WorkspaceInstance.isUpToDate(info.latestInstance, update)) {
346349
continue
347350
} else {

0 commit comments

Comments
 (0)