From 207c8fb9284133f6b2cd6374e0cc8947afca097f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Thu, 20 Apr 2023 20:35:55 +0000 Subject: [PATCH 01/10] Filter out experimental IDEs on the backend --- components/ide-service-api/go/ide.pb.go | 169 ++++++++++-------- components/ide-service-api/ide.proto | 4 +- .../ide-service-api/typescript/src/ide.pb.ts | 21 ++- components/ide-service/pkg/server/server.go | 32 +++- 4 files changed, 138 insertions(+), 88 deletions(-) diff --git a/components/ide-service-api/go/ide.pb.go b/components/ide-service-api/go/ide.pb.go index 915f750f3a6ef5..d979bf4152330e 100644 --- a/components/ide-service-api/go/ide.pb.go +++ b/components/ide-service-api/go/ide.pb.go @@ -74,6 +74,8 @@ type GetConfigRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } func (x *GetConfigRequest) Reset() { @@ -108,6 +110,13 @@ func (*GetConfigRequest) Descriptor() ([]byte, []int) { return file_ide_proto_rawDescGZIP(), []int{0} } +func (x *GetConfigRequest) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + type GetConfigResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -446,75 +455,78 @@ var File_ide_proto protoreflect.FileDescriptor var file_ide_proto_rawDesc = []byte{ 0x0a, 0x09, 0x69, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x69, 0x64, 0x65, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x22, 0x12, 0x0a, 0x10, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x22, 0x3d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0x2d, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, - 0x3f, 0x0a, 0x13, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x3b, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0xe6, 0x01, - 0x0a, 0x1d, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, - 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, - 0x0c, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x29, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x6f, 0x72, 0x6b, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x64, 0x65, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xac, 0x02, 0x0a, 0x1e, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x65, 0x6e, 0x76, - 0x76, 0x61, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x64, 0x65, - 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, - 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, - 0x52, 0x07, 0x65, 0x6e, 0x76, 0x76, 0x61, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x75, 0x70, - 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x12, 0x28, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6c, - 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x64, 0x65, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x49, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x61, 0x73, 0x6b, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x73, - 0x6b, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2a, 0x2a, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, - 0x52, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x52, 0x45, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x10, - 0x01, 0x32, 0xe5, 0x01, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x57, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x2e, - 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, - 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x7e, 0x0a, 0x16, 0x52, 0x65, 0x73, + 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2d, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3f, 0x0a, 0x13, 0x45, 0x6e, + 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3b, 0x0a, 0x04, 0x55, + 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0xe6, 0x01, 0x0a, 0x1d, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x2e, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, - 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, + 0x70, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x64, 0x65, 0x5f, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x69, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x77, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x22, 0xac, 0x02, 0x0a, 0x1e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x47, 0x0a, 0x18, 0x69, 0x6f, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x69, 0x64, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2f, 0x69, 0x64, 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x65, 0x6e, 0x76, 0x76, 0x61, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x76, + 0x76, 0x61, 0x72, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, + 0x6f, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, + 0x73, 0x75, 0x70, 0x65, 0x72, 0x76, 0x69, 0x73, 0x6f, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x77, 0x65, 0x62, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x77, 0x65, 0x62, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x10, + 0x69, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x69, 0x64, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, + 0x4c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x72, 0x49, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x21, 0x0a, + 0x0c, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x2a, 0x2a, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x10, 0x00, 0x12, 0x0c, + 0x0a, 0x08, 0x50, 0x52, 0x45, 0x42, 0x55, 0x49, 0x4c, 0x44, 0x10, 0x01, 0x32, 0xe5, 0x01, 0x0a, + 0x0a, 0x49, 0x44, 0x45, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x09, 0x47, + 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x21, 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x69, 0x64, + 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x03, 0x90, 0x02, 0x02, 0x12, 0x7e, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, + 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, + 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x69, 0x64, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x70, 0x69, + 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x03, 0x90, 0x02, 0x02, 0x42, 0x47, 0x0a, 0x18, 0x69, 0x6f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x69, 0x64, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x70, 0x69, + 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x69, 0x64, + 0x65, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -541,18 +553,19 @@ var file_ide_proto_goTypes = []interface{}{ (*ResolveWorkspaceConfigResponse)(nil), // 6: ide_service_api.ResolveWorkspaceConfigResponse } var file_ide_proto_depIdxs = []int32{ - 0, // 0: ide_service_api.ResolveWorkspaceConfigRequest.type:type_name -> ide_service_api.WorkspaceType - 4, // 1: ide_service_api.ResolveWorkspaceConfigRequest.user:type_name -> ide_service_api.User - 3, // 2: ide_service_api.ResolveWorkspaceConfigResponse.envvars:type_name -> ide_service_api.EnvironmentVariable - 1, // 3: ide_service_api.IDEService.GetConfig:input_type -> ide_service_api.GetConfigRequest - 5, // 4: ide_service_api.IDEService.ResolveWorkspaceConfig:input_type -> ide_service_api.ResolveWorkspaceConfigRequest - 2, // 5: ide_service_api.IDEService.GetConfig:output_type -> ide_service_api.GetConfigResponse - 6, // 6: ide_service_api.IDEService.ResolveWorkspaceConfig:output_type -> ide_service_api.ResolveWorkspaceConfigResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 4, // 0: ide_service_api.GetConfigRequest.user:type_name -> ide_service_api.User + 0, // 1: ide_service_api.ResolveWorkspaceConfigRequest.type:type_name -> ide_service_api.WorkspaceType + 4, // 2: ide_service_api.ResolveWorkspaceConfigRequest.user:type_name -> ide_service_api.User + 3, // 3: ide_service_api.ResolveWorkspaceConfigResponse.envvars:type_name -> ide_service_api.EnvironmentVariable + 1, // 4: ide_service_api.IDEService.GetConfig:input_type -> ide_service_api.GetConfigRequest + 5, // 5: ide_service_api.IDEService.ResolveWorkspaceConfig:input_type -> ide_service_api.ResolveWorkspaceConfigRequest + 2, // 6: ide_service_api.IDEService.GetConfig:output_type -> ide_service_api.GetConfigResponse + 6, // 7: ide_service_api.IDEService.ResolveWorkspaceConfig:output_type -> ide_service_api.ResolveWorkspaceConfigResponse + 6, // [6:8] is the sub-list for method output_type + 4, // [4:6] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_ide_proto_init() } diff --git a/components/ide-service-api/ide.proto b/components/ide-service-api/ide.proto index 9d1b92129f3b55..bc2382cc770ecc 100644 --- a/components/ide-service-api/ide.proto +++ b/components/ide-service-api/ide.proto @@ -18,7 +18,9 @@ service IDEService { } } -message GetConfigRequest {} +message GetConfigRequest { + User user = 1; +} message GetConfigResponse { string content = 1; diff --git a/components/ide-service-api/typescript/src/ide.pb.ts b/components/ide-service-api/typescript/src/ide.pb.ts index 5641e6011c20ba..f658a371b86c27 100644 --- a/components/ide-service-api/typescript/src/ide.pb.ts +++ b/components/ide-service-api/typescript/src/ide.pb.ts @@ -56,6 +56,7 @@ export function workspaceTypeToNumber(object: WorkspaceType): number { } export interface GetConfigRequest { + user: User | undefined; } export interface GetConfigResponse { @@ -96,11 +97,14 @@ export interface ResolveWorkspaceConfigResponse { } function createBaseGetConfigRequest(): GetConfigRequest { - return {}; + return { user: undefined }; } export const GetConfigRequest = { - encode(_: GetConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + encode(message: GetConfigRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } return writer; }, @@ -111,6 +115,9 @@ export const GetConfigRequest = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.user = User.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -119,17 +126,19 @@ export const GetConfigRequest = { return message; }, - fromJSON(_: any): GetConfigRequest { - return {}; + fromJSON(object: any): GetConfigRequest { + return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined }; }, - toJSON(_: GetConfigRequest): unknown { + toJSON(message: GetConfigRequest): unknown { const obj: any = {}; + message.user !== undefined && (obj.user = message.user ? User.toJSON(message.user) : undefined); return obj; }, - fromPartial(_: DeepPartial): GetConfigRequest { + fromPartial(object: DeepPartial): GetConfigRequest { const message = createBaseGetConfigRequest(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; return message; }, }; diff --git a/components/ide-service/pkg/server/server.go b/components/ide-service/pkg/server/server.go index 8205682f236cac..97be2cf4ae4f24 100644 --- a/components/ide-service/pkg/server/server.go +++ b/components/ide-service/pkg/server/server.go @@ -97,9 +97,35 @@ func (s *IDEServiceServer) register(grpcServer *grpc.Server) { } func (s *IDEServiceServer) GetConfig(ctx context.Context, req *api.GetConfigRequest) (*api.GetConfigResponse, error) { - return &api.GetConfigResponse{ - Content: s.parsedIDEConfigContent, - }, nil + configCatClient := experiments.NewClient() + experimentalIdesEnabled := configCatClient.GetBoolValue(ctx, "experimentalIdes", false, experiments.Attributes{ + UserID: req.User.Id, + UserEmail: *req.User.Email, + }) + + if experimentalIdesEnabled { + // We can return everything + return &api.GetConfigResponse{ + Content: s.parsedIDEConfigContent, + }, nil + } else { + for key, ide := range s.ideConfig.IdeOptions.Options { + if ide.Experimental && !experimentalIdesEnabled { + delete(s.ideConfig.IdeOptions.Options, key) + } + } + + parsedConfig, err := json.Marshal(s.ideConfig) + if err != nil { + log.WithError(err).Error("cannot marshal ide config") + return nil, err + } + s.parsedIDEConfigContent = string(parsedConfig) + + return &api.GetConfigResponse{ + Content: s.parsedIDEConfigContent, + }, nil + } } func (s *IDEServiceServer) readIDEConfig(ctx context.Context, isInit bool) { From 1f71d43646fa80bc981d1e3e72873c756331be65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Fri, 21 Apr 2023 16:55:56 +0000 Subject: [PATCH 02/10] Send the user along the server request --- components/server/src/ide-service.ts | 4 ++-- components/server/src/workspace/gitpod-server-impl.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/server/src/ide-service.ts b/components/server/src/ide-service.ts index 57043701b1cddd..1a7c80010d3671 100644 --- a/components/server/src/ide-service.ts +++ b/components/server/src/ide-service.ts @@ -34,9 +34,9 @@ export class IDEService { private cacheConfig?: IDEConfig; - async getIDEConfig(): Promise { + async getIDEConfig(request: IdeServiceApi.GetConfigRequest): Promise { try { - let resp = await this.ideService.getConfig({}); + let resp = await this.ideService.getConfig(request); let config: IDEConfig = JSON.parse(resp.content); this.cacheConfig = config; return config; diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index dbec0eac6ad817..458725a42ced1b 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3327,7 +3327,8 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { } async getIDEOptions(ctx: TraceContext): Promise { - const ideConfig = await this.ideService.getIDEConfig(); + const user = this.checkUser("identifyUser"); + const ideConfig = await this.ideService.getIDEConfig({ user }); return ideConfig.ideOptions; } From 3b9ee529c2d065b26889ef346824ed9d44cfec43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 09:31:25 +0000 Subject: [PATCH 03/10] Check for nils --- components/ide-service/pkg/server/server.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/ide-service/pkg/server/server.go b/components/ide-service/pkg/server/server.go index 97be2cf4ae4f24..8c9e5496c886a5 100644 --- a/components/ide-service/pkg/server/server.go +++ b/components/ide-service/pkg/server/server.go @@ -98,10 +98,15 @@ func (s *IDEServiceServer) register(grpcServer *grpc.Server) { func (s *IDEServiceServer) GetConfig(ctx context.Context, req *api.GetConfigRequest) (*api.GetConfigResponse, error) { configCatClient := experiments.NewClient() - experimentalIdesEnabled := configCatClient.GetBoolValue(ctx, "experimentalIdes", false, experiments.Attributes{ + attributes := experiments.Attributes{ UserID: req.User.Id, - UserEmail: *req.User.Email, - }) + UserEmail: "", + } + + if req.User.Email != nil { + attributes.UserEmail = *req.User.Email + } + experimentalIdesEnabled := configCatClient.GetBoolValue(ctx, "experimentalIdes", false, attributes) if experimentalIdesEnabled { // We can return everything From e6697137dc5eecc529b82a6005834d58621ae7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 09:31:41 +0000 Subject: [PATCH 04/10] nits --- components/server/src/ide-service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/server/src/ide-service.ts b/components/server/src/ide-service.ts index 1a7c80010d3671..f2d52708b05e90 100644 --- a/components/server/src/ide-service.ts +++ b/components/server/src/ide-service.ts @@ -36,8 +36,8 @@ export class IDEService { async getIDEConfig(request: IdeServiceApi.GetConfigRequest): Promise { try { - let resp = await this.ideService.getConfig(request); - let config: IDEConfig = JSON.parse(resp.content); + const response = await this.ideService.getConfig(request); + const config: IDEConfig = JSON.parse(response.content); this.cacheConfig = config; return config; } catch (e) { From 4cc3b3c38b91dc7df78c5f4d773a9d1b7f545451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 09:46:19 +0000 Subject: [PATCH 05/10] No frontend filtering anymore --- .../src/components/SelectIDEComponent.tsx | 14 +++++--------- .../dashboard/src/contexts/FeatureFlagContext.tsx | 5 ----- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/components/dashboard/src/components/SelectIDEComponent.tsx b/components/dashboard/src/components/SelectIDEComponent.tsx index 7967eae91850e8..bcec667c3d00c4 100644 --- a/components/dashboard/src/components/SelectIDEComponent.tsx +++ b/components/dashboard/src/components/SelectIDEComponent.tsx @@ -5,11 +5,10 @@ */ import { IDEOption, IDEOptions } from "@gitpod/gitpod-protocol/lib/ide-protocol"; -import { useCallback, useContext, useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { getGitpodService } from "../service/service"; import { DropDown2, DropDown2Element } from "./DropDown2"; import Editor from "../icons/Editor.svg"; -import { FeatureFlagContext } from "../contexts/FeatureFlagContext"; interface SelectIDEComponentProps { selectedIdeOption?: string; @@ -18,15 +17,12 @@ interface SelectIDEComponentProps { setError?: (error?: string) => void; } -function filteredIdeOptions(ideOptions: IDEOptions, experimentalTurnedOn: boolean) { - return IDEOptions.asArray(ideOptions) - .filter((x) => !x.hidden) - .filter((x) => (x.experimental ? experimentalTurnedOn : true)); +function filteredIdeOptions(ideOptions: IDEOptions) { + return IDEOptions.asArray(ideOptions).filter((x) => !x.hidden); } export default function SelectIDEComponent(props: SelectIDEComponentProps) { const [ideOptions, setIdeOptions] = useState(); - const { experimentalIdes } = useContext(FeatureFlagContext); useEffect(() => { getGitpodService().server.getIDEOptions().then(setIdeOptions); @@ -36,7 +32,7 @@ export default function SelectIDEComponent(props: SelectIDEComponentProps) { if (!ideOptions) { return []; } - const options = filteredIdeOptions(ideOptions, experimentalIdes); + const options = filteredIdeOptions(ideOptions); const result: DropDown2Element[] = []; for (const ide of options.filter((ide) => `${ide.label}${ide.title}${ide.notes}${ide.id}`.toLowerCase().includes(search.toLowerCase()), @@ -57,7 +53,7 @@ export default function SelectIDEComponent(props: SelectIDEComponentProps) { } return result; }, - [experimentalIdes, ideOptions, props.useLatest], + [ideOptions, props.useLatest], ); const internalOnSelectionChange = (id: string) => { const { ide, useLatest } = parseId(id); diff --git a/components/dashboard/src/contexts/FeatureFlagContext.tsx b/components/dashboard/src/contexts/FeatureFlagContext.tsx index e3a86c51bb5dc0..cc449e2799ff10 100644 --- a/components/dashboard/src/contexts/FeatureFlagContext.tsx +++ b/components/dashboard/src/contexts/FeatureFlagContext.tsx @@ -29,7 +29,6 @@ const defaultFeatureFlags = { userGitAuthProviders: false, newSignupFlow: false, linkedinConnectionForOnboarding: false, - experimentalIdes: false, }; const FeatureFlagContext = createContext(defaultFeatureFlags); @@ -48,7 +47,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => { const [userGitAuthProviders, setUserGitAuthProviders] = useState(false); const [newSignupFlow, setNewSignupFlow] = useState(false); const [linkedinConnectionForOnboarding, setLinkedinConnectionForOnboarding] = useState(false); - const [experimentalIdes, setExperimentalIdes] = useState(false); useEffect(() => { if (!user) return; @@ -67,7 +65,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => { userGitAuthProviders: { defaultValue: false, setter: setUserGitAuthProviders }, newSignupFlow: { defaultValue: false, setter: setNewSignupFlow }, linkedinConnectionForOnboarding: { defaultValue: false, setter: setLinkedinConnectionForOnboarding }, - experimentalIdes: { defaultValue: false, setter: setExperimentalIdes }, }; for (const [flagName, config] of Object.entries(featureFlags)) { @@ -115,7 +112,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => { userGitAuthProviders, newSignupFlow, linkedinConnectionForOnboarding, - experimentalIdes, }; }, [ enablePersonalAccessTokens, @@ -127,7 +123,6 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => { startWithOptions, usePublicApiWorkspacesService, userGitAuthProviders, - experimentalIdes, ]); return {children}; From b18fbec8015ea5f2e1cca787344977a5c7271b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 09:53:25 +0000 Subject: [PATCH 06/10] Typo fix --- components/ide-service/pkg/server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ide-service/pkg/server/server.go b/components/ide-service/pkg/server/server.go index 8c9e5496c886a5..95b132f568745f 100644 --- a/components/ide-service/pkg/server/server.go +++ b/components/ide-service/pkg/server/server.go @@ -36,7 +36,7 @@ type IDEServiceServer struct { parsedIDEConfigContent string ideConfig *config.IDEConfig ideConfigFileName string - experiemntsClient experiments.Client + experimentsClient experiments.Client api.UnimplementedIDEServiceServer } @@ -87,7 +87,7 @@ func New(cfg *config.ServiceConfiguration) *IDEServiceServer { s := &IDEServiceServer{ config: cfg, ideConfigFileName: fn, - experiemntsClient: experiments.NewClient(), + experimentsClient: experiments.NewClient(), } return s } From 560d8b9b04eee2456d7cf7ed6c38a1ae4b8ef213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 09:59:44 +0000 Subject: [PATCH 07/10] Minor refactor --- components/ide-service/pkg/server/server.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/ide-service/pkg/server/server.go b/components/ide-service/pkg/server/server.go index 95b132f568745f..6ae4f6c68f2fa9 100644 --- a/components/ide-service/pkg/server/server.go +++ b/components/ide-service/pkg/server/server.go @@ -100,12 +100,9 @@ func (s *IDEServiceServer) GetConfig(ctx context.Context, req *api.GetConfigRequ configCatClient := experiments.NewClient() attributes := experiments.Attributes{ UserID: req.User.Id, - UserEmail: "", + UserEmail: req.User.GetEmail(), } - if req.User.Email != nil { - attributes.UserEmail = *req.User.Email - } experimentalIdesEnabled := configCatClient.GetBoolValue(ctx, "experimentalIdes", false, attributes) if experimentalIdesEnabled { From ab4ca489de5ab2d2e982c7506c34dd786daa2f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 10:09:58 +0000 Subject: [PATCH 08/10] Add email address to the user --- components/server/src/workspace/gitpod-server-impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 458725a42ced1b..cecc5413255855 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3328,7 +3328,8 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { async getIDEOptions(ctx: TraceContext): Promise { const user = this.checkUser("identifyUser"); - const ideConfig = await this.ideService.getIDEConfig({ user }); + const email = User.getPrimaryEmail(user); + const ideConfig = await this.ideService.getIDEConfig({ ...user, email }); return ideConfig.ideOptions; } From e591d2dca286a1c21719c39544ce353505a0092a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 10:18:08 +0000 Subject: [PATCH 09/10] Type hacks --- components/server/src/ide-service.ts | 2 +- components/server/src/workspace/gitpod-server-impl.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/server/src/ide-service.ts b/components/server/src/ide-service.ts index f2d52708b05e90..479b9f86c0e760 100644 --- a/components/server/src/ide-service.ts +++ b/components/server/src/ide-service.ts @@ -34,7 +34,7 @@ export class IDEService { private cacheConfig?: IDEConfig; - async getIDEConfig(request: IdeServiceApi.GetConfigRequest): Promise { + async getIDEConfig(request: { id: string; email?: string }): Promise { try { const response = await this.ideService.getConfig(request); const config: IDEConfig = JSON.parse(response.content); diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index cecc5413255855..35b78d8fe6c048 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3329,7 +3329,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { async getIDEOptions(ctx: TraceContext): Promise { const user = this.checkUser("identifyUser"); const email = User.getPrimaryEmail(user); - const ideConfig = await this.ideService.getIDEConfig({ ...user, email }); + const ideConfig = await this.ideService.getIDEConfig({ id: user.id, email }); return ideConfig.ideOptions; } From 831a59d0bd967f0bf4691712924a18aca4d5f933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tron=C3=AD=C4=8Dek?= Date: Sat, 22 Apr 2023 10:21:35 +0000 Subject: [PATCH 10/10] Again lol --- components/server/src/ide-service.ts | 2 +- components/server/src/workspace/gitpod-server-impl.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/server/src/ide-service.ts b/components/server/src/ide-service.ts index 479b9f86c0e760..083283295feb62 100644 --- a/components/server/src/ide-service.ts +++ b/components/server/src/ide-service.ts @@ -34,7 +34,7 @@ export class IDEService { private cacheConfig?: IDEConfig; - async getIDEConfig(request: { id: string; email?: string }): Promise { + async getIDEConfig(request: { user: { id: string; email?: string } }): Promise { try { const response = await this.ideService.getConfig(request); const config: IDEConfig = JSON.parse(response.content); diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 35b78d8fe6c048..a35d44848f40eb 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3329,7 +3329,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { async getIDEOptions(ctx: TraceContext): Promise { const user = this.checkUser("identifyUser"); const email = User.getPrimaryEmail(user); - const ideConfig = await this.ideService.getIDEConfig({ id: user.id, email }); + const ideConfig = await this.ideService.getIDEConfig({ user: { id: user.id, email } }); return ideConfig.ideOptions; }