Skip to content

Add lifecycle support#199

Open
chris124567 wants to merge 1 commit into
masterfrom
christopher/ttl-incomplete
Open

Add lifecycle support#199
chris124567 wants to merge 1 commit into
masterfrom
christopher/ttl-incomplete

Conversation

@chris124567

Copy link
Copy Markdown
Member

Close #172

Copilot AI review requested due to automatic review settings June 9, 2026 23:27
@github-project-automation github-project-automation Bot moved this to In Progress in Sia Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?lifecycle bucket 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 thread .golangci.yml
Comment thread sia/lifecycle.go
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
}

@chris124567 chris124567 Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AWS buckets have no lifecycle policy by default... not sure what we want to do here

@chris124567 chris124567 requested review from ChrisSchinnerl, n8mgr and peterjan and removed request for ChrisSchinnerl, n8mgr and peterjan June 9, 2026 23:47
@chris124567 chris124567 marked this pull request as draft June 9, 2026 23:48
@chris124567 chris124567 force-pushed the christopher/ttl-incomplete branch from b10621a to f61e472 Compare June 9, 2026 23:57
@chris124567 chris124567 marked this pull request as ready for review June 10, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

No TTL or expiry for incomplete multipart uploads

3 participants