feat!: lifecycle commands; remove deprecated surface#95
Open
designcode wants to merge 6 commits intomainfrom
Open
feat!: lifecycle commands; remove deprecated surface#95designcode wants to merge 6 commits intomainfrom
designcode wants to merge 6 commits intomainfrom
Conversation
Add tigris buckets lifecycle (alias lc) with list, create, edit for multi-rule lifecycle management (transitions and TTL/expiration with optional prefix filter), backed by the updated @tigrisdata/storage SDK. Add a generic removed/replaced_by mechanism on CommandSpec and Argument so the cli-core can intercept removed entries with a clean redirect message instead of "unknown command/option". Removed commands are hidden from help and have no implementation file. Breaking changes: - buckets set-ttl and buckets set-transition removed; use buckets lifecycle create/edit - forks list and forks create removed; use buckets create --fork-of and buckets list --forks-of - --region and --consistency flags on mk, buckets create, buckets set removed; use --locations Other cleanup: - drop OperationSpec alias, ParsedPaths type, unused YAML anchors - update-docs and generate-registry skip removed entries - bucket-info no longer renders the deprecated ttlConfig row; the TTL rule appears under Lifecycle Rules like any other rule Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
When editing a transition rule, transitionDeltaFromInput only emitted the field the user set, so spreading over the existing target left both `days` and `date` populated. The API rejects rules with both. Same latent bug for expiration. Both helpers now explicitly emit the unset field as `undefined` so spreading clears it. Adds regression tests pinning the new behaviour. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rbarabas
approved these changes
May 7, 2026
Bug 3 (high): edit's call to validateRuleFieldCombinations rejected --days/--date without --storage-class even though the existing rule already has a class. Validator now takes a requireStorageClassForTiming flag (default true for create, false for edit). Edit performs the storage-class-and-timing check post-fetch against the merged rule, so both `--days 60` alone and `--storage-class IA` alone are accepted as long as the result is a valid transition. Bug 4 (medium): create accepted --storage-class without --days/--date, producing a transition rule without timing that the SDK silently dropped. Added the inverse check: --storage-class requires --days or --date. Adds regression tests for both fixes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bug 5: create.ts used a truthy check (input.prefix ?) while edit.ts
used input.prefix !== undefined, so --prefix "" was silently ignored
by create but applied by edit. Both now use !== undefined and the
shared validator rejects an empty --prefix.
Bug 6: utils/bucket-info.ts duplicated the transition-format string
("GLACIER after 30d") that lib/buckets/lifecycle/shared.ts also built
in formatTransitionCell. Extract describeTransition / describeExpiration
into utils/bucket-info.ts as the single source of truth; the cell
formatters now compose them with a "-" fallback.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
After CommandSpec.description was made optional for the removed-entry tombstones, three help-rendering paths in cli-core.ts still interpolated it directly, which would print the literal string "undefined" if a non-removed command lacked a description. Coerce with ?? '' to match the other rendering paths in the file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit b686e1d. Configure here.
The original `forks` command had `alias: f`. When tombstoning the entry the alias was dropped, so `tigris f` (and any other short-alias use) fell through to a generic "unknown command" error instead of the redirect message. Restore the alias so all entry points hit the redirect. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
tigris buckets lifecycle(aliaslc) withlist,create,editfor multi-rule lifecycle management (transitions and TTL/expiration with optional prefix filter), backed by the updated@tigrisdata/storageSDK.removed/replaced_bymechanism onCommandSpecandArgumentso the cli-core can intercept removed entries with a clean redirect message instead of "unknown command/option". Removed entries are hidden from--helpand have no implementation file.Breaking changes
tigris buckets set-ttlandtigris buckets set-transitionare removed. Usetigris buckets lifecycle create / editinstead.tigris forks listandtigris forks createare removed. Usetigris buckets create --fork-ofandtigris buckets list --forks-of.--regionand--consistencyflags ontigris mk,tigris buckets create, andtigris buckets setare removed. Use--locations.Each removed entry exits with a redirect message pointing at the replacement; nothing fails silently.
Other cleanup
OperationSpecalias,ParsedPathstype, unused YAML anchors (consistency_options,region_options).update-docsandgenerate-registryskipremovedentries automatically.bucket-infono longer renders the deprecatedttlConfigrow; the TTL rule appears underLifecycle Ruleslike any other rule.lib/buckets/lifecycle/shared.ts.Test plan
npm run lintandnpm run format:checkpassnpm testpasses (636 unit tests)npm run buildsucceedstigris forks,tigris buckets set-ttl,tigris buckets set-transition,tigris mk … --region,tigris buckets create … --region,tigris buckets set … --region,tigris mk … --consistencytigris buckets lifecycle --helplists onlylist,create,edittigris buckets lifecycle create / list / editend-to-end against a buckettigris buckets get <bucket>shows TTL-shaped rules underLifecycle Rules(no separate TTL row)🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because this introduces new lifecycle rule flows and changes CLI dispatch/help behavior (including hidden/removed commands and flags), which can break existing scripts if redirects or parsing differ from expectations.
Overview
Adds a new
tigris buckets lifecyclecommand group (list,create,edit) to manage multi-rule bucket lifecycle configuration (transitions and TTL/expiration, optionally scoped by prefix), including shared validation/formatting helpers and updated bucket info rendering for lifecycle rules.Introduces a generic hard-remove mechanism in the spec/types (
removed,replaced_by) and updatescli-core, docs generation, and registry generation to hide removed entries from help/docs while still parsing them to emit a clear redirect-and-exit message.Removes deprecated commands/flags and their implementations:
buckets set-ttl,buckets set-transition,forkscommands, plus deprecated--region/--consistencyhandling in bucket creation/update paths; tests are updated to assert redirect behavior and the new fork flow viabuckets create --fork-of/buckets list --forks-of. Dependency@tigrisdata/storageis bumped to^3.4.0.Reviewed by Cursor Bugbot for commit b4ed2c9. Bugbot is set up for automated code reviews on this repo. Configure here.