Skip to content

feat(storage): add Bundle API client support#76

Merged
efirs merged 1 commit intomainfrom
feat/bundle-api
Apr 6, 2026
Merged

feat(storage): add Bundle API client support#76
efirs merged 1 commit intomainfrom
feat/bundle-api

Conversation

@efirs
Copy link
Copy Markdown
Contributor

@efirs efirs commented Apr 3, 2026

Summary

  • Add bundle() function for streaming multi-object tar download via POST /{bucket}?bundle
  • SigV4-signed HTTP POST, returns streaming ReadableStream<Uint8Array>
  • Bundle header constants in shared TigrisHeaders enum
  • Exported generateSignatureHeaders from shared for reuse

Test plan

  • Unit tests: 8 tests covering validation, request construction, auth modes, HTTP errors
  • npm run test passes (84 tests)
  • npm run build passes

🤖 Generated with Claude Code


Note

Medium Risk
Introduces a new storage client request path that builds auth headers (SigV4 vs session token) and streams response bodies, so mistakes could break authentication or large-download behavior. Scope is contained to a new API plus header/export wiring and unit tests.

Overview
Adds a new bundle() storage client that POSTs to /{bucket}?bundle with a JSON list of object keys and returns a streaming tar (optionally compressed) response, with configurable compression and onError request headers.

Updates shared plumbing to support this: adds bundle-related TigrisHeaders constants, re-exports generateSignatureHeaders for reuse, and exposes bundle/types from packages/storage server entrypoint. Includes unit tests covering validation, request construction, auth modes (SigV4 vs session token/namespace), and HTTP/body error handling.

Reviewed by Cursor Bugbot for commit 9d77718. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 3, 2026

Greptile Summary

This PR adds a bundle() function to the Tigris Storage SDK that POSTs a list of object keys to /{bucket}?bundle and returns a streaming tar archive, with optional gzip/zstd compression and configurable missing-object error handling. The plumbing changes (new TigrisHeaders bundle constants, re-exporting generateSignatureHeaders, and adding the exports to server.ts) are clean and consistent with existing patterns.

Key highlights:

  • Auth logic (SigV4 when static key credentials are present, session-token/namespace headers otherwise) mirrors the existing createTigrisHttpClient pattern exactly.
  • Previously flagged issues — header constants not being used and credentialProvider not being handled — appear to have been addressed in this revision.
  • 8 unit tests cover validation, request shape, both auth paths, HTTP error responses, and the no-body edge case.
  • Minor: the JSDoc documents a "max 5,000 keys" limit that is not enforced client-side; callers exceeding the limit will receive a raw server error rather than a descriptive validation message.

Confidence Score: 5/5

This PR is safe to merge; all remaining findings are P2 style suggestions.

The only open finding is a P2 suggestion to enforce the documented 5,000-key limit client-side. All previously flagged P1 concerns (header constant usage, credentialProvider) have been resolved. The implementation is consistent with the existing codebase patterns and well-tested.

No files require special attention.

Important Files Changed

Filename Overview
packages/storage/src/lib/object/bundle.ts New bundle() implementation with SigV4/session-token auth; auth logic is consistent with http-client.ts, but the documented "max 5,000 keys" limit has no client-side enforcement.
packages/storage/src/lib/object/bundle.test.ts Good test coverage across validation, request construction, both auth paths, HTTP error handling, and missing-body edge case.
shared/headers.ts Adds three BUNDLE_* header constants to the TigrisHeaders enum; straightforward and consistent with existing entries.
shared/index.ts Re-exports generateSignatureHeaders for use by bundle.ts; minimal, correct change.
packages/storage/src/server.ts Exports bundle, BundleOptions, and BundleResponse from the server entrypoint; correct and complete.

Reviews (2): Last reviewed commit: "feat(storage): add Bundle API support fo..." | Re-trigger Greptile

Comment thread packages/storage/src/lib/object/bundle.ts Outdated
Comment thread packages/storage/src/lib/object/bundle.ts Outdated
Comment thread shared/headers.ts
@efirs efirs force-pushed the feat/bundle-api branch from 8827666 to 0ab6d53 Compare April 3, 2026 22:34
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0ab6d53. Configure here.

Comment thread packages/storage/src/lib/object/bundle.ts Outdated
Comment thread packages/storage/src/lib/object/bundle.ts Outdated
Comment thread packages/storage/src/lib/object/bundle.ts Outdated
…download

Add bundle() function that POSTs to /{bucket}?bundle with SigV4
signing and returns a streaming ReadableStream for tar consumption.

Includes unit tests and header constants.

Assisted-by: Claude Opus 4.6 via Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Yevgeniy Firsov <firsov@tigrisdata.com>
@efirs efirs force-pushed the feat/bundle-api branch from 0ab6d53 to 9d77718 Compare April 3, 2026 22:45
@efirs
Copy link
Copy Markdown
Contributor Author

efirs commented Apr 3, 2026

@greptileai review and summarize

@efirs efirs merged commit 9d77718 into main Apr 6, 2026
2 checks passed
@efirs efirs deleted the feat/bundle-api branch April 6, 2026 21:17
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

🎉 This PR is included in version 2.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants