Skip to content

feat: stats and update methods#61

Merged
designcode merged 4 commits intomainfrom
ai/bucket-info-update-object
Feb 17, 2026
Merged

feat: stats and update methods#61
designcode merged 4 commits intomainfrom
ai/bucket-info-update-object

Conversation

@designcode
Copy link
Collaborator

@designcode designcode commented Feb 16, 2026

Note

Medium Risk
Introduces new HTTP-based bucket metadata/stats calls and an object rename path that depends on CopyObject permissions, which may affect behavior for existing consumers and credentials.

Overview
Adds new public APIs getStats (bucket-level usage + listing metadata) and updateObject (rename via CopyObject+X-Tigris-Rename, and/or change ACL via PutObjectAcl).

Refactors getBucketInfo to stop relying on HeadBucket response headers and instead call a JSON metadata endpoint, expanding the response with structured forkInfo, settings (ACL + default tier), and sizeInfo, while deprecating the old fork-related fields.

Improves error handling by introducing handleError, tightening put’s caught error type, adding required headers (RENAME, COPY_SOURCE), exporting the new APIs from server.ts, and adding integration tests for updateObject.

Written by Cursor Bugbot for commit 35f2503. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Feb 16, 2026

Greptile Summary

Added getStats function to expose organization-level storage statistics and updateObject function to support renaming objects and updating ACLs. Expanded getBucketInfo to include fork details, settings, and size information.

Major Changes:

  • New getStats() function returns org-level stats (total objects, storage bytes, bucket list with metadata)
  • New updateObject() function supports renaming objects and changing ACL (public/private)
  • getBucketInfo() now returns detailed fork info, bucket settings, and size estimates
  • Deprecated consistency field in bucket creation options
  • Improved error handling in put() to use unknown instead of any

Issues Found:

  • Logical error in isSnapshotEnabled calculation (operator precedence)
  • Logical error in hasForks calculation (should check HasChildren not just ForkInfo existence)
  • Test attempting to update ACL on renamed file using original key will fail
  • Missing else if in error handler causing unnecessary second condition check

Confidence Score: 2/5

  • This PR has critical logical errors that will cause runtime bugs
  • Two critical logical errors in getBucketInfo will return incorrect values for isSnapshotEnabled and hasForks. A test also contains flawed logic that doesn't match its intent. These must be fixed before merging.
  • Pay close attention to packages/storage/src/lib/bucket/info.ts and packages/storage/src/test/integration.test.ts

Important Files Changed

Filename Overview
packages/storage/src/lib/bucket/info.ts Expanded to include fork info, settings, and size info; contains logical errors in isSnapshotEnabled and hasForks calculations
packages/storage/src/lib/object/update.ts New file implementing object rename and ACL update functionality
packages/storage/src/lib/stats.ts New file implementing organization-level stats with bucket details
packages/storage/src/test/integration.test.ts Added tests for updateObject; one test has incorrect logic testing renamed file with original key

Last reviewed commit: 67096cd

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

9 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

@designcode designcode force-pushed the ai/bucket-info-update-object branch from 67096cd to 9da3f55 Compare February 16, 2026 14:25
@designcode designcode force-pushed the ai/bucket-info-update-object branch from 9da3f55 to dbee05b Compare February 16, 2026 14:56
Implements updateObject that allows updating object ACL and key
Use httpClient in getBucketInfo to expand returned fields
@designcode designcode force-pushed the ai/bucket-info-update-object branch from dbee05b to 35f2503 Compare February 16, 2026 15:17
Copy link

@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 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@designcode designcode merged commit 3d5f627 into main Feb 17, 2026
2 checks passed
@designcode designcode deleted the ai/bucket-info-update-object branch February 17, 2026 08:25
@github-actions
Copy link

🎉 This PR is included in version 2.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

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