Skip to content

feat(sdk): warm pool management across typescript, python, go, ruby and java sdks - #145

Open
brunogrbavac wants to merge 1 commit into
mainfrom
feat/warm-pools
Open

feat(sdk): warm pool management across typescript, python, go, ruby and java sdks#145
brunogrbavac wants to merge 1 commit into
mainfrom
feat/warm-pools

Conversation

@brunogrbavac

@brunogrbavac brunogrbavac commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

Adds warm pool management to all five SDKs (TypeScript, Python, Go, Ruby, Java): list, create, update and delete, mirroring each SDK's existing per-resource service pattern. The returned model exposes currentSize vs pool plus errorReason as the status check, so no pollers or waiters were added. Includes unit tests and a runnable example per language. The spec and generated clients were already on main, so this is purely the hand-written surface. All five verified live against production.

Documentation

  • This change requires a documentation update
  • I have made corresponding changes to the documentation

Summary by cubic

Adds Warm Pool management to the TypeScript, Python, Go, Ruby, and Java SDKs so teams can keep ready-to-use sandboxes for snapshots. Supports listing, creating, updating, and deleting pools with simple status via current size vs desired pool.

  • New Features
    • New services per SDK: TypeScript daytona.warmPool, Python daytona.warm_pool (sync/async), Go client.WarmPool, Ruby daytona.warm_pool, Java daytona.warmPool().
    • Operations: list, create, update, delete. Set pool to 0 to drain. Status is currentSize vs pool; errorReason shows why a pool can’t fill (no waiters/pollers).
    • Added runnable examples and unit tests in all five SDKs.

Written for commit 300001b. Summary will update on new commits.

Review in cubic

…nd java sdks

Signed-off-by: Bruno Grbavac <bruno.grbavac@outlook.com>
@vidoc-agent

vidoc-agent Bot commented Jul 27, 2026

Copy link
Copy Markdown

Vidoc security review

Tip

Good to merge — no security issues found. Reviewed 35 changed files.

💬 Have questions? Tag @vidoc in a comment and I'll answer.

@brunogrbavac
brunogrbavac requested a review from MDzaja July 27, 2026 19:35
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅ Thank you!
Posted by the CLA Assistant Lite bot.

@brunogrbavac

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 27, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 35 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="sdk-java/src/main/java/io/daytona/sdk/WarmPoolService.java">

<violation number="1" location="sdk-java/src/main/java/io/daytona/sdk/WarmPoolService.java:1">
P3: This new SDK source file omits the repository-required Apache-2.0 copyright/SPDX header used by the other hand-written Java SDK files. Adding the standard header keeps licensing metadata and automated license checks consistent.</violation>
</file>

<file name="sdk-typescript/src/WarmPool.ts">

<violation number="1" location="sdk-typescript/src/WarmPool.ts:1">
P2: The new SDK source file will fail the repository's license-header check because it omits the required Apache-2.0 copyright/SPDX header; adding the standard header keeps this package compliant with the configured repository check.</violation>
</file>

<file name="sdk-go/pkg/daytona/warm_pool_test.go">

<violation number="1" location="sdk-go/pkg/daytona/warm_pool_test.go:92">
P2: Missing test coverage for `WarmPoolService.Update`. The service exposes a public `Update(ctx, warmPoolID, pool)` method, but this test file only covers `List`, `Create` (error), and `Delete` (error). Without an update test, the update code path — including its API call and error handling — is untested, leaving a gap in the PR's explicitly mentioned operations (list, create, update, delete).</violation>
</file>

<file name="examples/java/warm-pools/src/main/java/io/daytona/examples/WarmPools.java">

<violation number="1" location="examples/java/warm-pools/src/main/java/io/daytona/examples/WarmPools.java:28">
P2: Cleanup on line 28 is not guaranteed if a prior operation throws. Wrap the body in try/finally so delete still runs on failure — the Lifecycle example demonstrates this pattern.</violation>
</file>

<file name="sdk-ruby/lib/daytona/warm_pool_service.rb">

<violation number="1" location="sdk-ruby/lib/daytona/warm_pool_service.rb:1">
P2: New file is missing the standard copyright header that every other hand-written Ruby SDK file includes. The file starts with `# frozen_string_literal: true` but should be preceded by the two-line copyright block to match the project convention.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -0,0 +1,106 @@
import { WarmPoolsApi } from '@daytona/api-client'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new SDK source file will fail the repository's license-header check because it omits the required Apache-2.0 copyright/SPDX header; adding the standard header keeps this package compliant with the configured repository check.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At sdk-typescript/src/WarmPool.ts, line 1:

<comment>The new SDK source file will fail the repository's license-header check because it omits the required Apache-2.0 copyright/SPDX header; adding the standard header keeps this package compliant with the configured repository check.</comment>

<file context>
@@ -0,0 +1,106 @@
+import { WarmPoolsApi } from '@daytona/api-client'
+import type { CreateWarmPool, UpdateWarmPool, WarmPool as WarmPoolDto } from '@daytona/api-client'
+import { WithInstrumentation } from './utils/otel.decorator'
</file context>

@@ -0,0 +1,129 @@
package daytona

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Missing test coverage for WarmPoolService.Update. The service exposes a public Update(ctx, warmPoolID, pool) method, but this test file only covers List, Create (error), and Delete (error). Without an update test, the update code path — including its API call and error handling — is untested, leaving a gap in the PR's explicitly mentioned operations (list, create, update, delete).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At sdk-go/pkg/daytona/warm_pool_test.go, line 92:

<comment>Missing test coverage for `WarmPoolService.Update`. The service exposes a public `Update(ctx, warmPoolID, pool)` method, but this test file only covers `List`, `Create` (error), and `Delete` (error). Without an update test, the update code path — including its API call and error handling — is untested, leaving a gap in the PR's explicitly mentioned operations (list, create, update, delete).</comment>

<file context>
@@ -0,0 +1,129 @@
+	require.Error(t, err)
+}
+
+func TestWarmPoolDeleteError(t *testing.T) {
+	server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.Header().Set("Content-Type", "application/json")
</file context>

System.out.println("Updated desired size to " + updated.getPool());

// Cleanup
daytona.warmPool().delete(pool.getId());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Cleanup on line 28 is not guaranteed if a prior operation throws. Wrap the body in try/finally so delete still runs on failure — the Lifecycle example demonstrates this pattern.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/java/warm-pools/src/main/java/io/daytona/examples/WarmPools.java, line 28:

<comment>Cleanup on line 28 is not guaranteed if a prior operation throws. Wrap the body in try/finally so delete still runs on failure — the Lifecycle example demonstrates this pattern.</comment>

<file context>
@@ -0,0 +1,32 @@
+            System.out.println("Updated desired size to " + updated.getPool());
+
+            // Cleanup
+            daytona.warmPool().delete(pool.getId());
+            System.out.println("Deleted warm pool");
+        }
</file context>

@@ -0,0 +1,58 @@
# frozen_string_literal: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: New file is missing the standard copyright header that every other hand-written Ruby SDK file includes. The file starts with # frozen_string_literal: true but should be preceded by the two-line copyright block to match the project convention.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At sdk-ruby/lib/daytona/warm_pool_service.rb, line 1:

<comment>New file is missing the standard copyright header that every other hand-written Ruby SDK file includes. The file starts with `# frozen_string_literal: true` but should be preceded by the two-line copyright block to match the project convention.</comment>

<file context>
@@ -0,0 +1,58 @@
+# frozen_string_literal: true
+
+module Daytona
</file context>
Suggested change
# frozen_string_literal: true
# Copyright Daytona Platforms Inc.
# SPDX-License-Identifier: Apache-2.0
# frozen_string_literal: true

@@ -0,0 +1,102 @@
package io.daytona.sdk;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This new SDK source file omits the repository-required Apache-2.0 copyright/SPDX header used by the other hand-written Java SDK files. Adding the standard header keeps licensing metadata and automated license checks consistent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At sdk-java/src/main/java/io/daytona/sdk/WarmPoolService.java, line 1:

<comment>This new SDK source file omits the repository-required Apache-2.0 copyright/SPDX header used by the other hand-written Java SDK files. Adding the standard header keeps licensing metadata and automated license checks consistent.</comment>

<file context>
@@ -0,0 +1,102 @@
+package io.daytona.sdk;
+
+import io.daytona.api.client.api.WarmPoolsApi;
</file context>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant