Skip to content

feat(storage): add bucket lifecycle policies - #2130

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2774-storage-add-bucket-lifecycle-policies
Nov 18, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2774-storage-add-bucket-lifecycle-policies

Conversation

@spydon

@spydon spydon commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Adds get_bucket_lifecycle, update_bucket_lifecycle and delete_bucket_lifecycle to the storage client (SDK-2774).

  • New LifecycleRule and NoncurrentVersionExpiration models with snake_case fields; filter defaults to {}.
  • Unknown fields are kept, so rules read from Storage can be written back without loss.
  • get_bucket_lifecycle returns [] when the bucket has no policy.
  • Registers the three features in sdk-compliance.yaml.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added lifecycle-policy management for standard storage buckets. You can retrieve configured rules, replace them with new rules, or delete the policy.
    • Retrieving a bucket with no lifecycle policy returns an empty list. Updates return the stored rules, including identifiers generated by the service.

The SDK adds lifecycle rule models and StorageClient methods to retrieve, replace, and delete bucket lifecycle policies. Retrieval returns an empty list for NoSuchLifecycleConfiguration and propagates other API errors. Updates return the stored rules, including server-generated identifiers. Tests cover request and response behavior, error handling, and preservation of fields not defined by the models.

Change: Feature

Merge Risk: Minimal · up to 5879c

This adds bucket lifecycle get, update and delete operations to the storage client, with tests for the main request and response behavior. No merge-blocking risk was identified.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aa697ba6-9c00-4f0e-8975-6f50c535a404
Commits

Reviewing files that changed from the base of the PR and between 3ad73d9 and 5879c0f.

Files selected for processing: 4

  • sdk-compliance.yaml
  • src/storage/src/storage3/client.py
  • src/storage/src/storage3/types.py
  • src/storage/tests/test_client.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@spydon
spydon merged commit ff8a232 into main Nov 18, 2026
28 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2774-storage-add-bucket-lifecycle-policies branch November 18, 2026 19:52
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.

1 participant