Add lifecycle support#199
Open
chris124567 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds S3 bucket lifecycle configuration support end-to-end (S3 API routes → Sia backend → SQLite persistence) and introduces a background lifecycle loop to apply rules (abort incomplete multipart uploads and expire objects) based on prefix filters and time cutoffs.
Changes:
- Implement
?lifecyclebucket subresource (PUT/GET/DELETE) with lifecycle XML validation and cutoff calculations. - Persist per-bucket lifecycle configurations in SQLite and add lifecycle cleanup queries for aborting multipart uploads / expiring objects (plus supporting indexes).
- Add a Sia background lifecycle loop and tests covering API behavior, validation, persistence, and on-disk cleanup effects.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
sia/sia.go |
Extends the store interface and starts the lifecycle background loop. |
sia/lifecycle.go |
Implements lifecycle configuration storage/reading and periodic rule application (abort/expire + cleanup). |
sia/lifecycle_test.go |
Integration-style test asserting lifecycle rule application and disk cleanup. |
sia/export_test.go |
Exposes lifecycle application for testing. |
sia/persist/sqlite/migrations.go |
Adds DB migration for lifecycle config table + indexes for lifecycle queries. |
sia/persist/sqlite/init.sql |
Updates baseline schema with lifecycle config table + new indexes. |
sia/persist/sqlite/lifecycle.go |
Implements lifecycle configuration persistence and lifecycle-driven abort/expire queries. |
sia/persist/sqlite/lifecycle_test.go |
Unit tests for lifecycle persistence and cleanup queries. |
s3/s3.go |
Extends the backend interface with lifecycle configuration operations. |
s3/messages.go |
Adds XML message types for lifecycle configuration documents. |
s3/lifecycle.go |
Implements lifecycle request routing/handlers and lifecycle validation/cutoff logic. |
s3/lifecycle_test.go |
Exercises lifecycle API behavior, validation mapping, and access control. |
s3/buckets.go |
Routes ?lifecycle to the new lifecycle handlers; removes it from unsupported subresources. |
internal/testutil/testutil.go |
Adds AWS SDK convenience wrappers for lifecycle APIs in tests. |
README.md |
Documents lifecycle support and updates the supported-operations table. |
.golangci.yml |
Disables the revive confusing-naming rule. |
.changeset/add_lifecycle_support.md |
Adds a changeset entry for lifecycle support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+89
to
+94
| configs, err := s.store.AllBucketLifecycleConfigurations() | ||
| if err != nil { | ||
| s.logger.Error("failed to load lifecycle configurations", zap.Error(err)) | ||
| return | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
AWS buckets have no lifecycle policy by default... not sure what we want to do here
b10621a to
f61e472
Compare
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.
Close #172