Repository navigation
Conversation
Add a versioned `v1` alias of the current client API to every SDK, for code that wants to pin the API version explicitly. The alias returns the same client and changes no behavior: - Python: `daytona.v1` module re-exporting the public API, plus a `v1` property on `Daytona` and `AsyncDaytona` - TypeScript: `@daytona/sdk/v1` subpath export (ESM, CJS and a node10 fallback) plus a `daytona.v1` getter - Go: `Client.V1()` - Ruby: `Daytona::Daytona#v1` and the `Daytona::V1` module alias - Java: `Daytona.v1()` Add an optional `target` to the sandbox create params in every SDK. It overrides the client-level target for that call. Deprecate the client-level `target` config and the `DAYTONA_TARGET` environment variable with each language's native mechanism; both keep working. Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
Vidoc security reviewTip Good to merge — no security issues found. Reviewed 50 changed files. 💬 Have questions? Tag @vidoc in a comment and I'll answer. |
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 50 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="artifacts/sdk-docs/typescript-sdk/daytona.mdx">
<violation number="1" location="artifacts/sdk-docs/typescript-sdk/daytona.mdx:542">
P2: This setting also seeds the default region for snapshot creation, but the migration advice only covers Sandbox creation. Mention `regionId` on Snapshot create params so callers preserve snapshot placement when replacing the deprecated setting.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Accept pointer params in Go Create, warn on the Ruby target writer, treat a blank Ruby per-create target as unset, list v1 in dir(daytona), and document the target fallback order and snapshot region replacement. Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 50 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
|
@cubic-dev-ai review this PR |
@MDzaja I have started the AI code review. It will take a few minutes to complete. |
Description
Adds a versioned
v1alias of the current client API to every SDK, for code that wants to pin the API version explicitly.v1returns the same client (or re-exports the same module), so existing code behaves exactly as before.Daytona().v1/AsyncDaytona().v1(typedSelf);from daytona.v1 import ...re-exports the full public API, resolved lazily like the root packagedaytona.v1getter (returnsthis);@daytona/sdk/v1subpath export for ESM and CJS, plus av1/package.jsonfallback formoduleResolution: nodeclient.V1()method returning the same*Client(a method, not a field, so it always refers to the receiver and cannot be reassigned)daytona.v1returnsself;Daytona::V1is theDaytonamodule itself (Daytona::V1::Daytona,Daytona::V1::Config, ...)daytona.v1()returnsthisAlso adds an optional
targetto the sandbox create params in every SDK (CreateSandboxFromSnapshotParams/CreateSandboxFromImageParams, GoSandboxBaseParams.Target, JavaCreateSandboxParams#setTarget). It overrides the client-level target for that call; when omitted, behavior is unchanged.The client-level
targetconfig and theDAYTONA_TARGETenvironment variable are deprecated, using each language's native mechanism. Both keep working:DeprecationWarningwhen either is set, plus a docstring note@deprecatedonDaytonaConfig.target, plus aconsole.warnwhen either is set (matching the existingDAYTONA_SERVER_URLdeprecation)// Deprecated:onDaytonaConfig.Target;DAYTONA_TARGETdocumented as deprecatedwarn(withuplevel) when either is set, plus YARD@deprecated@DeprecatedonDaytonaConfig#getTargetandDaytonaConfig.Builder#targetThe client-level target still seeds the default snapshot region where an SDK already did that. The deprecation messages point to
region_id/regionIdon snapshot create for that case.Verification (run locally in the Nix dev shells):
pylintclean,basedpyright0 errors / 0 warnings,pytest825 passedjest455 passed (21 suites),nx build+attw --packgreen for@daytona/sdk/v1in node10, node16 (CJS and ESM) and bundler. The packed tarball was also installed into a scratch project, whererequire('@daytona/sdk/v1'),import '@daytona/sdk/v1'andtsc(node10/node16/bundler) all resolve to the same classes.golangci-lint0 issues,go test -race ./...315 top-level tests passed (485 including subtests),examples/gobuildsrspec578 examples, 0 failures. RuboCop reports 204 offenses both onmainand on this branch, so this change adds none../gradlew buildgreen, 381 tests passedDocumentation
SDK READMEs gain "Create a sandbox in a specific region" and "Pin the API version" sections, config examples drop the deprecated
target, and theregionexamples (Python sync and async, TypeScript, Java) now passtargetper create. SDK reference docs underartifacts/sdk-docs/are regenerated; the Go docs keep only the hunks this change produces, not unrelated generator churn.Related Issue(s)
None.
Notes
daytona.v1/@daytona/sdk/v1are excluded from the generated reference docs so the API is not documented twice.Summary by cubic
Adds a versioned
v1alias of the current client API to every SDK, so code can explicitly pin the API version without changing behavior.v1returns the same client (Goclient.V1(), Javadaytona.v1(),daytona.v1elsewhere) or re-exports the same module (daytona.v1,@daytona/sdk/v1,Daytona::V1).Adds an optional
targetto sandbox create params that overrides the client-level target for that call, falling back through the per-createtarget, the client-leveltarget, thenDAYTONA_TARGET, before the organization's default region. The client-level config andDAYTONA_TARGETare deprecated but still work, emitting a deprecation warning via each language's native mechanism. GoCreatenow also accepts pointer snapshot/image params.Migration
targeton each sandbox create call instead of the client-level config.region_id/regionIdinstead of relying on the deprecated client target for the default region.Written for commit 3116d95. Summary will update on new commits.