memory-bank/components/ide-service-api.md
The IDE Service API defines the gRPC interfaces for the IDE Service, which is responsible for managing IDE configurations and resolving workspace IDE requirements within the Gitpod platform. This API enables the dynamic configuration of IDEs based on user preferences and workspace requirements.
This API provides a standardized interface for:
The IDE Service API is implemented as a gRPC service defined in Protocol Buffer files. These definitions are used to generate client and server code in various languages (Go, TypeScript, Java) for use by other components in the system.
Provides methods for IDE configuration and workspace resolution:
GetConfig: Retrieves IDE configuration for a specific userResolveWorkspaceConfig: Resolves the IDE configuration for a workspace based on various inputsRepresents a user in the system:
Enum defining the type of workspace:
REGULAR: Standard development workspacePREBUILD: Prebuild workspace for faster startupRepresents an environment variable as a key-value pair:
Contains the resolved configuration for a workspace:
The API uses Protocol Buffers version 3 (proto3) syntax, which provides forward and backward compatibility features. The service is designed to allow for the addition of new configuration options without breaking existing clients.
The workspace configuration resolution process considers multiple factors:
The resolution process produces a complete configuration including:
This allows for a highly customizable yet consistent IDE experience across different workspaces and users.
The IDE Service API uses Protocol Buffers and gRPC for defining interfaces. When changes are made to the .proto files, the corresponding code in various languages needs to be regenerated.
To regenerate the code:
Navigate to the ide-service-api directory:
cd components/ide-service-api
Run the generate script:
./generate.sh
This script performs the following actions:
protoc-gen-go and protoc-gen-go-grpcts_protoThe IDE Service API generates TypeScript code using the ts_proto plugin, which creates more modern TypeScript interfaces compared to the standard protoc TypeScript generator.
After regenerating the code, you may need to rebuild components that depend on the IDE Service API. This typically involves:
For Go components:
cd <component-directory>
go build ./...
For TypeScript components:
cd <component-directory>
yarn install
yarn build
Using Leeway (for CI/CD):
leeway build -D components/<component-name>:app