Skip to content

feat(sdk/js): add OSSFS volume backend support - #515

Merged
ninan-nn merged 2 commits into
opensandbox-group:mainfrom
perhapzz:fix/js-sdk-ossfs-volume-support
Mar 25, 2026
Merged

feat(sdk/js): add OSSFS volume backend support#515
ninan-nn merged 2 commits into
opensandbox-group:mainfrom
perhapzz:fix/js-sdk-ossfs-volume-support

Conversation

@perhapzz

Copy link
Copy Markdown
Contributor

Summary

Add Alibaba Cloud OSSFS mount backend support to the JavaScript/TypeScript sandbox SDK, aligning it with the Python SDK which already supports OSSFS.

Changes:

  • models/sandboxes.ts: Add OSSFS interface with full type definitions (bucket, endpoint, version, options, accessKeyId, accessKeySecret)
  • models/sandboxes.ts: Update Volume interface to include ossfs as a third backend option alongside host and pvc
  • sandbox.ts: Update volume validation to check [host, pvc, ossfs] backends
  • index.ts: Export OSSFS type for SDK consumers
  • tests/sandbox.create.test.mjs: Add 3 test cases for OSSFS volumes

Partially addresses #476 (SDK parity gaps — OSSFS support for JavaScript SDK).

Testing

  • Unit tests
  • TypeScript type check (tsc --noEmit passes)
✔ Sandbox.create passes OSSFS volume to request (0.158ms)
✔ Sandbox.create rejects volume with no backend (0.137ms)
✔ Sandbox.create rejects volume with multiple backends (0.141ms)
ℹ tests 8 | pass 8 | fail 0

Breaking Changes

  • None

The Volume interface is extended with an optional ossfs field. Existing code using host or pvc backends is unaffected.

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

Add Alibaba Cloud OSSFS mount backend to the JavaScript/TypeScript
sandbox SDK, aligning it with the Python SDK implementation.
Changes:
- Add OSSFS interface to models/sandboxes.ts with full type definitions
(bucket, endpoint, version, options, accessKeyId, accessKeySecret)
- Update Volume interface to include ossfs as a third backend option
- Update volume validation in sandbox.ts to check [host, pvc, ossfs]
- Export OSSFS type from index.ts
- Add 3 tests: OSSFS volume creation, no-backend rejection,
multi-backend rejection
Partially addresses opensandbox-group#476 (SDK parity gaps - OSSFS support)

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:55704bb598

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadsdks/sandbox/javascript/src/sandbox.ts Outdated
@PangjipingPangjiping added feature New feature or request sdk/js labels Mar 22, 2026
Address Codex review feedback: use `!= null` instead of `!== undefined`
so that JSON-normalized null optionals (e.g. `{ ossfs: null }`) are
correctly treated as absent rather than counting as a specified backend.
Add test case to verify null backends do not trigger multi-backend error.

@ninan-nnninan-nn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ninan-nn
ninan-nn merged commit 49f6c6b into opensandbox-group:mainMar 25, 2026
11 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureNew feature or requestsdk/js

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@perhapzz@ninan-nn@hittyt@Pangjiping