Skip to content

feat(adapter): ✨ add S3 storage adapter (experimental)#38

Merged
justapithecus merged 5 commits into
mainfrom
andrew/feat/adapter/s3
Feb 3, 2026
Merged

feat(adapter): ✨ add S3 storage adapter (experimental)#38
justapithecus merged 5 commits into
mainfrom
andrew/feat/adapter/s3

Conversation

@justapithecus

Copy link
Copy Markdown
Member

Implement internal S3 adapter supporting AWS S3, MinIO, LocalStack, and R2. Uses AWS SDK v2 with injected client for testability.

Features:

  • Full Store interface implementation
  • True byte-range reads (ReadRange, ReaderAt)
  • Immutability enforcement (ErrPathExists on overwrite)
  • Path validation and prefix support
  • Client configuration helpers for S3-compatible backends
  • Docker Compose for LocalStack/MinIO integration testing

Test gates:

  • Unit tests: go test ./internal/s3/...
  • Integration tests: LODE_S3_TESTS=1 go test -tags=integration ./internal/s3/...

justapithecus and others added 5 commits February 2, 2026 22:09
Implement internal S3 adapter supporting AWS S3, MinIO, LocalStack,
and R2. Uses AWS SDK v2 with injected client for testability.

Features:
- Full Store interface implementation
- True byte-range reads (ReadRange, ReaderAt)
- Immutability enforcement (ErrPathExists on overwrite)
- Path validation and prefix support
- Client configuration helpers for S3-compatible backends
- Docker Compose for LocalStack/MinIO integration testing

Test gates:
- Unit tests: go test ./internal/s3/...
- Integration tests: LODE_S3_TESTS=1 go test -tags=integration ./internal/s3/...

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use If-None-Match: "*" conditional write to enforce immutability
  atomically, avoiding check-then-write race condition
- Map PreconditionFailed to ErrPathExists
- Return empty slice immediately for ReadRange with length=0,
  avoiding invalid range header
- Add unit tests for zero-length ReadRange behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contract requires ErrNotFound for missing paths regardless of length.
Zero-length reads now perform HeadObject existence check before
returning empty slice.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Clarify that consistency guarantees are backend-dependent (AWS S3 vs
  MinIO/LocalStack/R2 may differ)
- Pin LocalStack to 4.0.3 and MinIO to RELEASE.2024-11-07 for
  reproducible integration tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- LocalStack: 4.0.3 → 4.3.0
- MinIO: RELEASE.2024-11-07 → RELEASE.2025-10-15T17-29-55Z
  (last official Docker Hub release before discontinuation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@justapithecus justapithecus merged commit c5e9eb1 into main Feb 3, 2026
4 checks passed
@justapithecus justapithecus deleted the andrew/feat/adapter/s3 branch February 3, 2026 03:28
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