diff --git a/components/gitpod-protocol/go/gitpod-service.go b/components/gitpod-protocol/go/gitpod-service.go index 97cce8540461f9..c69a410605c2da 100644 --- a/components/gitpod-protocol/go/gitpod-service.go +++ b/components/gitpod-protocol/go/gitpod-service.go @@ -1707,8 +1707,9 @@ type StartWorkspaceOptions struct { // GetWorkspaceTimeoutResult is the GetWorkspaceTimeoutResult message type type GetWorkspaceTimeoutResult struct { - CanChange bool `json:"canChange,omitempty"` - Duration string `json:"duration,omitempty"` + CanChange bool `json:"canChange,omitempty"` + DurationRaw string `json:"durationRaw,omitempty"` + Duration string `json:"duration,omitempty"` } // WorkspaceInstancePort is the WorkspaceInstancePort message type diff --git a/components/gitpod-protocol/src/gitpod-service.ts b/components/gitpod-protocol/src/gitpod-service.ts index 9d08bc5a7a0288..faf7cddf33a232 100644 --- a/components/gitpod-protocol/src/gitpod-service.ts +++ b/components/gitpod-protocol/src/gitpod-service.ts @@ -380,6 +380,7 @@ export interface SetWorkspaceTimeoutResult { export interface GetWorkspaceTimeoutResult { duration: WorkspaceTimeoutDuration; + durationRaw: string; canChange: boolean; } diff --git a/components/server/ee/src/workspace/gitpod-server-impl.ts b/components/server/ee/src/workspace/gitpod-server-impl.ts index f0845b696ecfc1..bbbcc20cd078a3 100644 --- a/components/server/ee/src/workspace/gitpod-server-impl.ts +++ b/components/server/ee/src/workspace/gitpod-server-impl.ts @@ -356,7 +356,8 @@ export class GitpodServerEEImpl extends GitpodServerImpl { const runningInstance = await this.workspaceDb.trace(ctx).findRunningInstance(workspaceId); if (!runningInstance) { log.warn({ userId: user.id, workspaceId }, "Can only get keep-alive for running workspaces"); - return { duration: WORKSPACE_TIMEOUT_DEFAULT_SHORT, canChange }; + const duration = WORKSPACE_TIMEOUT_DEFAULT_SHORT; + return { duration, durationRaw: this.userService.workspaceTimeoutToDuration(duration), canChange }; } await this.guardAccess({ kind: "workspaceInstance", subject: runningInstance, workspace: workspace }, "get"); @@ -366,7 +367,9 @@ export class GitpodServerEEImpl extends GitpodServerImpl { const client = await this.workspaceManagerClientProvider.get(runningInstance.region); const desc = await client.describeWorkspace(ctx, req); const duration = this.userService.durationToWorkspaceTimeout(desc.getStatus()!.getSpec()!.getTimeout()); - return { duration, canChange }; + const durationRaw = this.userService.workspaceTimeoutToDuration(duration); + + return { duration, durationRaw, canChange }; } public async isPrebuildDone(ctx: TraceContext, pwsId: string): Promise {