Skip to content

feat(storage): support soft delete in createBucket - #421

Merged
designcode merged 3 commits into
mainfrom
aibrahim/tig-12669-support-setting-soft-delete-when-creating
Nov 18, 2026
Merged

designcode merged 3 commits into
mainfrom
aibrahim/tig-12669-support-setting-soft-delete-when-creating

Conversation

@designcode

@designcode designcode commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

createBucket can now enable soft delete when the bucket is created, so the console can use the SDK for its create-bucket call. The CLI exposes it on tigris buckets create.

  • createBucket: new softDelete option ({ enabled: true, retentionDays }), sent as X-Tigris-Soft-Delete: <retentionDays> on the CreateBucket request. Soft delete is enabled atomically with creation; there is no follow-up update.
  • Validation: retentionDays must be a whole number between 7 and 90, checked before any request is sent.
  • Shared type: the soft delete shape is now BucketSoftDelete in bucket/types.ts, used by createBucket, updateBucket and getBucketInfo, and exported from the package.
  • CLI: tigris buckets create my-bucket --soft-delete --retention-days 30. --retention-days is required with --soft-delete and rejected without it. Not added to tigris mk.
  • READMEs and changesets (minor for @tigrisdata/storage and @tigrisdata/cli).

The console sends "true" for the default 7 days and the number otherwise. The SDK always sends the number, so the result does not depend on the server's default.

Testing

  • SDK unit tests capture the CreateBucket request and assert the header value for 7, 30 and 90 days, its absence when disabled or omitted, and the retention bounds.
  • SDK integration tests create buckets with 7 and 30 days and read the setting back with getBucketInfo, and check that an out-of-range value creates no bucket (looked up by name).
  • CLI unit tests check the option passed to createBucket and each validation error. A CLI integration test creates a bucket with --soft-delete --retention-days 30 and checks buckets get; it was skipped locally (no access keys), so CI is its first run.

Also in this PR

A separate commit bumps the Biome config schema to 2.6.8 (biome migrate) and applies the formatter's fixes to four markdown files. Since #405, biome check fails on main without it, which blocks the pre-commit hook.

Refs: TIG-12669

🤖 Generated with Claude Code


Note

Medium Risk
Changes bucket creation semantics and retention configuration, but behavior is additive, validated client-side, and covered by new unit and integration tests.

Overview
Buckets can now be created with soft delete enabled in one step, instead of only via updateBucket after the fact.

@tigrisdata/storage: createBucket accepts a softDelete option using the new shared BucketSoftDelete type (also used by updateBucket and getBucketInfo). When enabled, retention is applied on the CreateBucket request via X-Tigris-Soft-Delete: <days> (no follow-up update). Values outside 7–90 whole days are rejected before any request is sent.

@tigrisdata/cli: tigris buckets create gains --soft-delete and --retention-days with the same validation and wiring into createBucket. Docs/specs/examples and unit plus CLI integration tests cover the happy path and flag combinations.

Minor changesets bump both packages. Biome’s schema is updated to 2.6.8 with markdown formatting fixes in several docs (including CLI README whitespace for Examples sections).

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

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The reviewed changes appear safe to merge; no blocking issues were found.

Summary

Adds soft delete at bucket creation in the storage SDK and exposes it through tigris buckets create.

  • The storage SDK can set soft-delete retention when it creates a bucket.
  • The bucket-create command can enable soft delete with a chosen retention window.
  • The Biome schema link and Markdown layout are updated without changing behavior.

No new actionable issues found. The earlier test concern is addressed by checking the bucket by name instead of searching one listing page.

Reviews (3) · Last reviewed commit: "feat(cli): support soft delete when crea..." · Reviewed by Greptile

designcode and others added 2 commits November 17, 2026 10:09
createBucket accepts a softDelete option, sent as X-Tigris-Soft-Delete
with the retention period in days on the CreateBucket request, so soft
delete is enabled atomically with creation. retentionDays is validated
to be a whole number between 7 and 90 before any request is sent.

Move the soft delete shape into a shared BucketSoftDelete type, used by
createBucket, updateBucket and getBucketInfo.

Refs: TIG-12669
Assisted-by: Claude Fable 5.2 via Claude Code
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Biome 2.6.8 (#405) formats four markdown files differently, which
fails the repo-wide check. Bump the config schema with biome migrate
and apply the formatter's fixes.

Assisted-by: Claude Fable 5.2 via Claude Code
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@designcode
designcode force-pushed the aibrahim/tig-12669-support-setting-soft-delete-when-creating branch from d80591e to 357db63 Compare November 17, 2026 16:09
Add --soft-delete and --retention-days to `buckets create`, passed to
createBucket so soft delete is set on the create request.

Refs: TIG-12669

Assisted-by: Claude Opus 5.5 via Claude Code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@designcode
designcode merged commit 80b47c7 into main Nov 18, 2026
3 checks passed
@designcode
designcode deleted the aibrahim/tig-12669-support-setting-soft-delete-when-creating branch November 18, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants