Skip to content

feat: bucket soft-delete lifecycle support#106

Merged
designcode merged 4 commits into
mainfrom
feat/soft-delete
Jun 9, 2026
Merged

feat: bucket soft-delete lifecycle support#106
designcode merged 4 commits into
mainfrom
feat/soft-delete

Conversation

@designcode

@designcode designcode commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Wires up the soft-delete features added in @tigrisdata/storage 3.12 across the bucket commands, completing the soft-delete lifecycle: configure → discover → recover.

Changes

  • buckets set — new --soft-delete enable|disable (with --retention-days <N> required when enabling). Deprecates --enable-delete-protection in favor of --soft-delete (still functional, flagged in --help).
  • buckets list — new --deleted flag to list only soft-deleted buckets.
  • buckets get — surfaces new getBucketInfo properties: Locations (structured, previously not shown at all), Soft Delete (with retention days), and Additional Headers.
  • buckets restore — new command to recover a soft-deleted bucket within its retention window.
  • InfraArgument spec gains a deprecated field; deprecated args render as (deprecated) … Use <x> instead. in help output.

Lifecycle

tigris buckets set my-bucket --soft-delete enable --retention-days 30
tigris buckets delete my-bucket --yes
tigris buckets list --deleted
tigris buckets restore my-bucket

Notes

  • --enable-delete-protection is deprecated, not removed — existing behavior and the "Delete Protection" row in get are preserved alongside the new "Soft Delete" row.
  • Bumps @tigrisdata/storage to ^3.12.0.

Testing

  • New unit coverage in test/utils/bucket-info.test.ts (Locations, Soft Delete, Additional Headers).
  • New CLI tests for buckets set --soft-delete validation and buckets restore.
  • npm run build, lint, format check, and 283 unit tests pass. Manually tested by the author.

🤖 Generated with Claude Code


Note

Medium Risk
Changes bucket configuration and delete/recovery behavior against live storage APIs; misconfiguration or restore misuse could affect data availability, though validation and deprecation preserve existing delete-protection paths.

Overview
Adds end-to-end bucket soft-delete support by bumping @tigrisdata/storage to ^3.12.0 and wiring new storage APIs into the CLI.

Configure & inspect: buckets set gains --soft-delete enable|disable with required --retention-days when enabling; --enable-delete-protection is deprecated (still works) in favor of soft delete. buckets get now shows Locations, Soft Delete (with retention), and Additional Headers.

Discover & recover: buckets list adds --deleted for soft-deleted buckets only; --forks-of now uses listForks instead of scanning all buckets with per-bucket getBucketInfo. New buckets restore recovers a bucket within its retention window.

CLI infra: Spec Argument type and help rendering support deprecated / replaced_by (parallel to existing removed).

Tests cover soft-delete validation, restore errors, and expanded buildBucketInfo output.

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

Wire up the soft-delete features added in @tigrisdata/storage 3.12:

- buckets set: add --soft-delete enable|disable with --retention-days,
  and deprecate --enable-delete-protection in favor of --soft-delete
- buckets list: add --deleted to list only soft-deleted buckets
- buckets get: surface new getBucketInfo properties (Locations,
  Soft Delete, Additional Headers)
- buckets restore: new command to recover a soft-deleted bucket within
  its retention window
- support marking arguments as deprecated in --help output

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/lib/buckets/set.ts
Comment thread src/lib/buckets/list.ts
Address review feedback:
- buckets set: reject --retention-days unless --soft-delete enable is set,
  instead of silently dropping it
- buckets list: warn when --deleted is combined with --forks-of, which
  ignores --deleted (matches existing pagination-flag behavior)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread src/cli-core.ts
Comment thread src/lib/buckets/list.ts Outdated
Address review feedback:
- cli-core: apply the deprecated annotation in formatArgumentHelp so the
  `help` subcommand surfaces deprecated flags, matching `--help`
- buckets list: guard the forks path against a missing forks array,
  matching the existing listBuckets empty-result check

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

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 8b38422. Configure here.

Comment thread src/lib/buckets/set.ts
When --soft-delete had an invalid value and --retention-days was present,
the orphan-retention guard fired first with a misleading message. Reorder
so the enable/disable value check reports first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit 2092bcd into main Jun 9, 2026
3 checks passed
@designcode designcode deleted the feat/soft-delete branch June 9, 2026 12:51
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Xe added a commit that referenced this pull request Jun 16, 2026
`npm run updatedocs` regenerates the whole README from specs.yaml, which
pulled in pre-existing soft-delete command docs that were never
regenerated after #106. Restore the README to main and re-apply only the
`project` command sections so this PR's docs are scoped to its change.

Assisted-by: Claude Opus 4.8 via Claude Code
Signed-off-by: Xe Iaso <xe@tigrisdata.com>
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