Skip to content

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

Merged
ninan-nn merged 2 commits intoalibaba: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 intoalibaba: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 alibaba#476 (SDK parity gaps - OSSFS support)
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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".

@Pangjiping Pangjiping 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.
Copy link
Copy Markdown
Collaborator

@ninan-nn ninan-nn left a comment

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 alibaba:main Mar 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request sdk/js

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants