Skip to content

Commit f6ec098

Browse files
Merge branch 'main' into exp/migration
2 parents 17d19cf + c4d64c0 commit f6ec098

File tree

13 files changed

+1740
-469
lines changed

13 files changed

+1740
-469
lines changed

components/gitpod-protocol/go/gitpod-service.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,8 +1765,16 @@ type WorkspaceInstanceConditions struct {
17651765

17661766
// WorkspaceInstanceConfiguration is the WorkspaceInstanceConfiguration message type
17671767
type WorkspaceInstanceConfiguration struct {
1768-
FeatureFlags []string `json:"featureFlags,omitempty"`
1769-
TheiaVersion string `json:"theiaVersion,omitempty"`
1768+
FeatureFlags []string `json:"featureFlags,omitempty"`
1769+
TheiaVersion string `json:"theiaVersion,omitempty"`
1770+
IDEConfig *WorkspaceInstanceIDEConfig `json:"ideConfig,omitempty"`
1771+
}
1772+
1773+
// WorkspaceInstanceIDEConfig is the ide config information of a workspace instance
1774+
type WorkspaceInstanceIDEConfig struct {
1775+
UseLatest bool `json:"useLatest,omitempty"`
1776+
IDE string `json:"ide,omitempty"`
1777+
PreferToolbox bool `json:"preferToolbox,omitempty"`
17701778
}
17711779

17721780
// WorkspaceInstanceRepoStatus is the WorkspaceInstanceRepoStatus message type

components/public-api-server/pkg/apiv1/workspace.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,21 @@ func convertWorkspaceInfo(input *protocol.WorkspaceInfo) (*v1.Workspace, error)
434434
}, nil
435435
}
436436

437+
func convertIdeConfig(ideConfig *protocol.WorkspaceInstanceIDEConfig) *v1.WorkspaceInstanceStatus_EditorReference {
438+
if ideConfig == nil {
439+
return nil
440+
}
441+
ideVersion := "stable"
442+
if ideConfig.UseLatest {
443+
ideVersion = "latest"
444+
}
445+
return &v1.WorkspaceInstanceStatus_EditorReference{
446+
Name: ideConfig.IDE,
447+
Version: ideVersion,
448+
PreferToolbox: ideConfig.PreferToolbox,
449+
}
450+
}
451+
437452
func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.WorkspaceContext, config *protocol.WorkspaceConfig, shareable bool) (*v1.WorkspaceInstance, error) {
438453
if wsi == nil {
439454
return nil, nil
@@ -521,6 +536,11 @@ func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.W
521536

522537
gitStatus := convertGitStatus(wsi.GitStatus)
523538

539+
var editor *v1.WorkspaceInstanceStatus_EditorReference
540+
if wsi.Configuration != nil && wsi.Configuration.IDEConfig != nil {
541+
editor = convertIdeConfig(wsi.Configuration.IDEConfig)
542+
}
543+
524544
return &v1.WorkspaceInstance{
525545
InstanceId: wsi.ID,
526546
WorkspaceId: wsi.WorkspaceID,
@@ -539,6 +559,7 @@ func convertWorkspaceInstance(wsi *protocol.WorkspaceInstance, wsCtx *protocol.W
539559
Ports: ports,
540560
RecentFolders: recentFolders,
541561
GitStatus: gitStatus,
562+
Editor: editor,
542563
},
543564
}, nil
544565
}

components/public-api/gitpod/experimental/v1/workspaces.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,15 @@ message WorkspaceInstanceStatus {
290290
optional bool stopped_by_request = 11;
291291
}
292292

293+
message EditorReference {
294+
string name = 1;
295+
string version = 2;
296+
297+
// prefer_toolbox indicates whether the editor should be launched with the
298+
// JetBrains Toolbox instead of JetBrains Gateway
299+
bool prefer_toolbox = 3;
300+
}
301+
293302
// version of the status update. Workspace instances themselves are unversioned,
294303
// but their statuus has different versions.
295304
// The value of this field has no semantic meaning (e.g. don't interpret it as
@@ -322,6 +331,9 @@ message WorkspaceInstanceStatus {
322331
// Note: this is a best-effort field and more often than not will not be present. Its absence does not
323332
// indicate the absence of a working copy.
324333
GitStatus git_status = 9;
334+
335+
// editor is the editor to be used in this workspace
336+
EditorReference editor = 10;
325337
}
326338

327339
// PortPolicy defines the accssbility policy of a workspace port is guarded by an authentication in the proxy

components/public-api/go/experimental/v1/workspaces.pb.go

Lines changed: 373 additions & 273 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)