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}; diff --git a/components/dashboard/src/user-settings/SelectIDE.tsx b/components/dashboard/src/user-settings/SelectIDE.tsx index 1652c2f8c6ab2b..1cde2714d3338f 100644 --- a/components/dashboard/src/user-settings/SelectIDE.tsx +++ b/components/dashboard/src/user-settings/SelectIDE.tsx @@ -71,7 +71,7 @@ export default function SelectIDE(props: SelectIDEProps) { ); //todo(ft): find a better way to group IDEs by vendor - const shouldShowJetbrainsNotice = !["code", "code-desktop"].includes(defaultIde); // a really hacky way to get just JetBrains IDEs + const shouldShowJetbrainsNotice = !["code", "code-desktop", "xterm"].includes(defaultIde); // a really hacky way to get just JetBrains IDEs return ( <> diff --git a/components/ide-proxy/static/image/ide-logo/terminal.svg b/components/ide-proxy/static/image/ide-logo/terminal.svg new file mode 100644 index 00000000000000..7992255eefa918 --- /dev/null +++ b/components/ide-proxy/static/image/ide-logo/terminal.svg @@ -0,0 +1,4 @@ + + + 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..7e053a172759e9 100644 --- a/components/ide-service/pkg/server/server.go +++ b/components/ide-service/pkg/server/server.go @@ -31,12 +31,14 @@ import ( ) type IDEServiceServer struct { - config *config.ServiceConfiguration - originIDEConfig []byte - parsedIDEConfigContent string - ideConfig *config.IDEConfig - ideConfigFileName string - experiemntsClient experiments.Client + config *config.ServiceConfiguration + originIDEConfig []byte + parsedIDEConfigContent string + parsedIDENonExperimental string + ideConfig *config.IDEConfig + nonExperimentalIDEConfig *config.IDEConfig + ideConfigFileName string + experimentsClient experiments.Client api.UnimplementedIDEServiceServer } @@ -87,7 +89,7 @@ func New(cfg *config.ServiceConfiguration) *IDEServiceServer { s := &IDEServiceServer{ config: cfg, ideConfigFileName: fn, - experiemntsClient: experiments.NewClient(), + experimentsClient: experiments.NewClient(), } return s } @@ -97,9 +99,23 @@ 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() + attributes := experiments.Attributes{ + UserID: req.User.Id, + UserEmail: req.User.GetEmail(), + } + + experimentalIdesEnabled := configCatClient.GetBoolValue(ctx, "experimentalIdes", false, attributes) + + if experimentalIdesEnabled { + return &api.GetConfigResponse{ + Content: s.parsedIDEConfigContent, + }, nil + } else { + return &api.GetConfigResponse{ + Content: s.parsedIDENonExperimental, + }, nil + } } func (s *IDEServiceServer) readIDEConfig(ctx context.Context, isInit bool) { @@ -108,20 +124,50 @@ func (s *IDEServiceServer) readIDEConfig(ctx context.Context, isInit bool) { log.WithError(err).Warn("cannot read ide config file") return } - if config, err := ParseConfig(ctx, b); err != nil { + if ideConfig, err := ParseConfig(ctx, b); err != nil { if !isInit { log.WithError(err).Fatal("cannot parse ide config") } log.WithError(err).Error("cannot parse ide config") return } else { - parsedConfig, err := json.Marshal(config) + parsedConfig, err := json.Marshal(ideConfig) if err != nil { log.WithError(err).Error("cannot marshal ide config") return } + + // Precompute the config without experimental IDEs + ideOptions := ideConfig.IdeOptions.Options + nonExperimentalIdeOptions := make(map[string]config.IDEOption) + for key, ide := range ideOptions { + if !ide.Experimental { + nonExperimentalIdeOptions[key] = ide + } + } + + nonExperimentalConfig := &config.IDEConfig{ + SupervisorImage: ideConfig.SupervisorImage, + IdeOptions: config.IDEOptions{ + Options: nonExperimentalIdeOptions, + DefaultIde: ideConfig.IdeOptions.DefaultIde, + DefaultDesktopIde: ideConfig.IdeOptions.DefaultDesktopIde, + Clients: ideConfig.IdeOptions.Clients, + }, + } + + parsedNonExperimentalConfig, err := json.Marshal(nonExperimentalConfig) + if err != nil { + log.WithError(err).Error("cannot marshal non-experimental ide config") + return + } + s.parsedIDEConfigContent = string(parsedConfig) - s.ideConfig = config + s.ideConfig = ideConfig + + s.nonExperimentalIDEConfig = nonExperimentalConfig + s.parsedIDENonExperimental = string(parsedNonExperimentalConfig) + s.originIDEConfig = b log.Info("ide config updated") diff --git a/components/server/src/ide-service.ts b/components/server/src/ide-service.ts index 57043701b1cddd..083283295feb62 100644 --- a/components/server/src/ide-service.ts +++ b/components/server/src/ide-service.ts @@ -34,10 +34,10 @@ export class IDEService { private cacheConfig?: IDEConfig; - async getIDEConfig(): Promise { + async getIDEConfig(request: { user: { id: string; email?: string } }): Promise { try { - let resp = await this.ideService.getConfig({}); - 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) { diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index dbec0eac6ad817..a35d44848f40eb 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -3327,7 +3327,9 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { } async getIDEOptions(ctx: TraceContext): Promise { - const ideConfig = await this.ideService.getIDEConfig(); + const user = this.checkUser("identifyUser"); + const email = User.getPrimaryEmail(user); + const ideConfig = await this.ideService.getIDEConfig({ user: { id: user.id, email } }); return ideConfig.ideOptions; } diff --git a/components/supervisor/frontend/src/shared/loading-frame.ts b/components/supervisor/frontend/src/shared/loading-frame.ts index 22686fbb8b50c5..5f31729a764443 100644 --- a/components/supervisor/frontend/src/shared/loading-frame.ts +++ b/components/supervisor/frontend/src/shared/loading-frame.ts @@ -16,7 +16,7 @@ export function load(): Promise<{ frame.src = startUrl.toString(); frame.style.visibility = "visible"; frame.className = "gitpod-frame loading"; - document.body.appendChild(frame); + document.body.prepend(frame); frame.onload = () => { const frontendDashboardServiceClient = new FrontendDashboardServiceClient(frame.contentWindow!); diff --git a/install/installer/pkg/components/blobserve/configmap.go b/install/installer/pkg/components/blobserve/configmap.go index 96ee1615352c6c..161b8451c6b58f 100644 --- a/install/installer/pkg/components/blobserve/configmap.go +++ b/install/installer/pkg/components/blobserve/configmap.go @@ -99,6 +99,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { PrePull: []string{}, Workdir: "/.supervisor/frontend", }, + ctx.RepoName(ctx.Config.Repository, ide.XtermIDEImage): { + PrePull: []string{}, + Workdir: "/ide/xterm", + InlineStatic: []blobserve_config.InlineReplacement{{ + Search: "/_supervisor/frontend", + Replacement: "${supervisor}", + }}, + }, }, BlobSpace: blobserve_config.BlobSpace{ Location: "/mnt/cache/blobserve", diff --git a/install/installer/pkg/components/ide-service/ide_config_configmap.go b/install/installer/pkg/components/ide-service/ide_config_configmap.go index 613ab59c4e82d8..90281802b5055b 100644 --- a/install/installer/pkg/components/ide-service/ide_config_configmap.go +++ b/install/installer/pkg/components/ide-service/ide_config_configmap.go @@ -34,6 +34,7 @@ func ideConfigConfigmap(ctx *common.RenderContext) ([]runtime.Object, error) { webstorm := "webstorm" rider := "rider" clion := "clion" + xterm := "xterm" resolveLatestImage := func(name string, tag string, bundledLatest versions.Versioned) string { resolveLatest := true @@ -195,6 +196,18 @@ func ideConfigConfigmap(ctx *common.RenderContext) ([]runtime.Object, error) { ImageLayers: []string{jbPluginImage, jbLauncherImage}, LatestImageLayers: []string{jbPluginLatestImage, jbLauncherImage}, }, + xterm: { + OrderKey: "12", + Title: "Terminal", + Type: ide_config.IDETypeBrowser, + Logo: getIdeLogoPath("terminal"), + Label: "Insiders", + // todo(ft): implement proper versioning for xterm + Image: ctx.ImageName(ctx.Config.Repository, ide.XtermIDEImage, "latest"), + LatestImage: ctx.ImageName(ctx.Config.Repository, ide.XtermIDEImage, "latest"), + ResolveImageDigest: true, + Experimental: true, + }, }, DefaultIde: "code", DefaultDesktopIde: codeDesktop, diff --git a/install/installer/pkg/components/workspace/ide/constants.go b/install/installer/pkg/components/workspace/ide/constants.go index 3dc15b63b25d45..bace7313f9078c 100644 --- a/install/installer/pkg/components/workspace/ide/constants.go +++ b/install/installer/pkg/components/workspace/ide/constants.go @@ -12,6 +12,7 @@ const ( CodeWebExtensionVersion = "commit-993573cfcc9f02dec825f8e333d52fa0e95ada8d" // gitpod-web extension version comes from https://github.com/gitpod-io/gitpod-code CodeDesktopIDEImage = "ide/code-desktop" CodeDesktopInsidersIDEImage = "ide/code-desktop-insiders" + XtermIDEImage = "ide/xterm-web" IntelliJDesktopIDEImage = "ide/intellij" GoLandDesktopIdeImage = "ide/goland" PyCharmDesktopIdeImage = "ide/pycharm"