Skip to content

feat: default-tier updates and snapshot-scoped object restore - #204

Merged
designcode merged 2 commits into
mainfrom
feat/default-tier-change
Jul 24, 2026
Merged

feat: default-tier updates and snapshot-scoped object restore#204
designcode merged 2 commits into
mainfrom
feat/default-tier-change

Conversation

@designcode

@designcode designcode commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two capabilities across the storage SDK and CLI:

  1. Change an existing bucket's default tierupdateBucket({ defaultTier })
    in the SDK, surfaced as tigris buckets set --default-tier <tier>.
  2. Snapshot-scoped object restorerestoreObject / getRestoreInfo accept
    snapshotVersion to target a point-in-time bucket snapshot, surfaced as
    tigris objects restore|restore-info --snapshot-version <version> (alias --snapshot).

Also refactors the duplicated snapshot-version build middleware (previously
copy-pasted across get/head/list/restore) into a shared
addSnapshotVersionMiddleware helper.

Changes

@tigrisdata/storage (a3b3222)

  • updateBucket: new defaultTier option → storage_class in the settings PATCH body
  • restoreObject / getRestoreInfo: new snapshotVersion option → X-Tigris-Snapshot-Version header
  • Extract shared addSnapshotVersionMiddleware helper (get/head/list/restore)

@tigrisdata/cli (2c43dfe)

  • buckets set --default-tier
  • objects restore --snapshot-version / restore-info --snapshot-version (alias --snapshot)

Testing

  • SDK: new integration tests — bucket-update default-tier round-trip and
    snapshot-scoped restore, verified against the live gateway; existing
    restore/object-versions suites pass (16/16).
  • CLI: specs-completeness passes (313/313); built-CLI --help shows all three
    flags; tsc + Biome clean.

Notes

  • Changesets intentionally deferred — will add pnpm changeset entries for
    both @tigrisdata/storage and @tigrisdata/cli (minor) after review and amend
    them into their respective commits.

🤖 Generated with Claude Code


Note

Medium Risk
Changes bucket default tier via PATCH (affects future uploads) and adds snapshot-scoped restore against live storage APIs; additive but touches core bucket/object behavior.

Overview
Adds default storage tier updates for existing buckets and snapshot-pinned archive restore across the storage SDK and CLI.

Bucket default tier: updateBucket accepts defaultTier, sent as storage_class on the bucket settings PATCH. The CLI exposes this as tigris buckets set --default-tier (reusing existing tier options).

Snapshot-scoped restore: restoreObject and getRestoreInfo accept optional snapshotVersion, which sets X-Tigris-Snapshot-Version on the S3 request. CLI: tigris objects restore and restore-info add --snapshot-version (alias --snapshot).

Refactor: Duplicated snapshot-header middleware in get/head/list/restore is consolidated into addSnapshotVersionMiddleware; restore paths now use the same helper.

Minor changesets for @tigrisdata/storage and @tigrisdata/cli, plus integration tests for tier round-trips and snapshot restore flows.

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

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Greptile Summary

Adds support for updating a bucket's default storage tier and restoring or inspecting objects within a specified bucket snapshot.

  • Maps the SDK's new defaultTier update option to the bucket settings PATCH payload and exposes it through buckets set --default-tier.
  • Adds snapshot-version request middleware to restore operations and consolidates existing snapshot header injection into a shared helper.
  • Exposes snapshot selection through the CLI's objects restore and restore-info commands.
  • Adds live integration coverage for bucket-tier updates and snapshot-scoped object restoration.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete correctness or security failures identified in the changed paths.

The new bucket field matches the existing REST response and settings shape, the shared middleware preserves the prior command-scoped header behavior, and CLI values and aliases are consistently propagated into the SDK.

Important Files Changed

Filename Overview
packages/storage/src/lib/bucket/update.ts Adds the correctly typed storage_class field to bucket update payloads while preserving omitted settings.
packages/storage/src/lib/object/middleware.ts Centralizes command-scoped snapshot-version header injection without changing the existing get, head, or list behavior.
packages/storage/src/lib/object/restore.ts Adds snapshot-scoped restore and restore-status requests using the shared command middleware.
packages/cli/src/lib/buckets/set.ts Parses the spec-constrained default-tier option and forwards it to the storage SDK.
packages/cli/src/lib/objects/restore.ts Forwards the snapshot-version option and alias to snapshot-scoped object restoration.
packages/cli/src/lib/objects/restore-info.ts Forwards the snapshot-version option and alias when retrieving restore state.
packages/cli/src/specs.yaml Declares the new tier and snapshot flags consistently with existing CLI option processing.
packages/storage/src/test/bucket-update.integration.test.ts Covers all supported default tiers, round-trip propagation, and preservation during unrelated updates.
packages/storage/src/test/restore.integration.test.ts Exercises snapshot-scoped restore and status reporting against an archived object.

Reviews (1): Last reviewed commit: "feat(cli): support default-tier updates ..." | Re-trigger Greptile

designcode and others added 2 commits July 23, 2026 21:29
- updateBucket: add `defaultTier` to change an existing bucket's default
  storage class via the settings PATCH body
- restoreObject / getRestoreInfo: add `snapshotVersion` to target a
  point-in-time bucket snapshot
- refactor: extract the duplicated snapshot-version build middleware into a
  shared `addSnapshotVersionMiddleware` helper used by get/head/list/restore
- test: add updateBucket default-tier round-trip and snapshot-restore
  integration coverage

Assisted-by: Claude Opus 4.8 (1M context) via Claude Code

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

- buckets set: add `--default-tier` to change an existing bucket's default
  storage tier
- objects restore / restore-info: add `--snapshot-version` (alias
  `--snapshot`) to target a point-in-time bucket snapshot

Assisted-by: Claude Opus 4.8 (1M context) via Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@designcode
designcode force-pushed the feat/default-tier-change branch from 2c43dfe to 5d48f51 Compare July 23, 2026 19:53
@designcode
designcode merged commit bb29d3a into main Jul 24, 2026
2 checks passed
@designcode
designcode deleted the feat/default-tier-change branch July 24, 2026 06:08
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