Skip to content

feat(storage)!: add pagination to listBucketSnapshots and remove deprecated fields#79

Merged
designcode merged 2 commits intomainfrom
fix/support-pagination-in-snapshot-list
Apr 8, 2026
Merged

feat(storage)!: add pagination to listBucketSnapshots and remove deprecated fields#79
designcode merged 2 commits intomainfrom
fix/support-pagination-in-snapshot-list

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Apr 8, 2026

add pagination to listBucketSnapshots and remove deprecated fields

Add paginationToken and limit support to listBucketSnapshots. Remove all deprecated fields across the storage package: snapshotName, description, consistency, region, regions, hasForks, sourceBucketName, sourceBucketSnapshot, contentType (presigned-url), and path (upload).

BREAKING CHANGE: listBucketSnapshots now returns { snapshots, paginationToken } instead of an array. Removed deprecated fields from CreateBucketOptions, UpdateBucketOptions, BucketInfoResponse, GetPresignedUrlOptions, CreateBucketSnapshotOptions, and UploadResponse.

Assisted-by: Claude Opus 4.6 via Claude Code


Note

Medium Risk
Medium risk because it introduces breaking API shape changes (notably listBucketSnapshots response) and removes previously accepted options/fields, requiring downstream updates; runtime logic changes are limited to snapshot listing pagination and header handling.

Overview
Adds pagination support to listBucketSnapshots by accepting paginationToken/limit, forwarding them to S3 ListBucketsCommand, and returning { snapshots, paginationToken } (with a new exported BucketSnapshot type) instead of an array.

Removes a set of deprecated fields and behaviors across the storage package: legacy bucket region/regions + consistency handling, deprecated fork fields on BucketInfoResponse, deprecated snapshot fields (snapshotName, snapshot description), deprecated contentType option for getPresignedUrl, and deprecated path field from upload client requests/responses; tests and headers are updated accordingly.

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

…ecated fields

Add paginationToken and limit support to listBucketSnapshots. Remove all
deprecated fields across the storage package: snapshotName, description,
consistency, region, regions, hasForks, sourceBucketName,
sourceBucketSnapshot, contentType (presigned-url), and path (upload).

BREAKING CHANGE: listBucketSnapshots now returns { snapshots, paginationToken }
instead of an array. Removed deprecated fields from CreateBucketOptions,
UpdateBucketOptions, BucketInfoResponse, GetPresignedUrlOptions,
CreateBucketSnapshotOptions, and UploadResponse.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 8, 2026

Greptile Summary

This PR adds pagination (paginationToken and limit) to listBucketSnapshots, changes its return type from an array to { snapshots, paginationToken }, and removes all deprecated fields across the storage package (consistency, region, regions, hasForks, sourceBucketName, sourceBucketSnapshot, snapshotName, contentType, path). The breaking changes are clearly documented and the implementation is clean.

Confidence Score: 5/5

Safe to merge — breaking changes are intentional, well-scoped, and correctly implemented.

All remaining findings are P2 style suggestions; no correctness, data-integrity, or reliability issues were found. The pagination implementation maps correctly to the AWS SDK types, and all deprecated field removals are consistent with their prior @deprecated annotations.

packages/storage/src/lib/upload/server.ts — stale contentType on ClientUploadRequest

Vulnerabilities

No security concerns identified.

Important Files Changed

Filename Overview
packages/storage/src/lib/bucket/snapshot.ts Adds paginationToken/limit to ListBucketSnapshotsOptions; changes return type from array to { snapshots, paginationToken }; removes deprecated snapshotName; exports new BucketSnapshot type. Pagination maps correctly to ListBucketsCommand ContinuationToken/MaxBuckets.
packages/storage/src/lib/bucket/create.ts Removes deprecated consistency and region fields from CreateBucketOptions along with their validation and header-setting logic.
packages/storage/src/lib/bucket/info.ts Removes deprecated hasForks, sourceBucketName, and sourceBucketSnapshot fields from BucketInfoResponse and their mapping from the API response.
packages/storage/src/lib/bucket/update.ts Removes deprecated regions field from UpdateBucketOptions and its handling logic; locations remains as the sole mechanism.
packages/storage/src/lib/object/presigned-url.ts Removes deprecated contentType field from GetPresignedUrlOptions.
packages/storage/src/lib/upload/client.ts Removes deprecated path field from UploadResponse and all JSON request bodies; name is now the sole identifier field.
packages/storage/src/lib/upload/server.ts Removes contentType from destructured request fields and from the SinglepartInit presigned URL call; contentType remains declared on ClientUploadRequest but is now silently discarded.
packages/storage/src/server.ts Exports the new BucketSnapshot type from snapshot.ts.
packages/storage/src/test/bucket-create.integration.test.ts Removes the integration test for the now-deleted region validation; remaining tests correctly reflect the updated createBucket API.

Comments Outside Diff (1)

  1. packages/storage/src/lib/upload/server.ts, line 14 (link)

    P2 Stale contentType in ClientUploadRequest

    contentType is still declared on ClientUploadRequest but is no longer destructured or forwarded to getPresignedUrl after that field was removed from GetPresignedUrlOptions. The client still sends it in the request body (e.g., SinglepartInit, MultipartInit), so the server silently discards it. For consistency with the rest of the cleanup in this PR it should either be removed or marked @deprecated.

Reviews (1): Last reviewed commit: "feat(storage)!: add pagination to listBu..." | Re-trigger Greptile

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 2 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 fdc1f5b. Configure here.

Comment thread packages/storage/src/lib/upload/server.ts
Comment thread packages/storage/src/lib/bucket/create.ts
Remove unused availableRegions, validateRegions, and
TigrisHeaders.CONSISTENT. Deprecate contentType in ClientUploadRequest.

Assisted-by: Claude Opus 4.6 via Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@designcode designcode merged commit dfd78de into main Apr 8, 2026
2 checks passed
@designcode designcode deleted the fix/support-pagination-in-snapshot-list branch April 8, 2026 17:45
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

🎉 This PR is included in version 3.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 📦🚀

@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