Skip to content

feat(parquet): implement the S3 / S3-compatible Store backend (rfc0013 green) - #235

Merged
jensholdgaard merged 2 commits into
mainfrom
rfc0013-green-s3-backend
Jun 16, 2026
Merged

feat(parquet): implement the S3 / S3-compatible Store backend (rfc0013 green)#235
jensholdgaard merged 2 commits into
mainfrom
rfc0013-green-s3-backend

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented Jun 16, 2026

Copy link
Copy Markdown
Owner

RFC 0013 green — first S3-arc slice: Store::s3 now builds a real AmazonS3 backend (was a placeholder). Infra-independent; live tests follow.

What

  • Store::s3(S3Config)object_store::aws::AmazonS3 via AmazonS3Builder (new aws feature). Works against AWS S3 or any S3-compatible endpoint (Hetzner, R2, …) through S3Config::endpoint, inferring allow_http for plain-HTTP dev endpoints.
  • Credentials from the standard AWS credential chain (env AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, shared profile, or IMDS); S3Config carries only non-secret addressing (bucket/endpoint/region/prefix). Explicit RFC 0004 cred wiring is a later refinement.
  • Keeps object_store's default S3ConditionalPut::ETagMatch — the If-Match CAS the manifest generation-swap needs (RFC0013.3/.4), confirmed available on the S3 backend.
  • StoreError::Config for pre-construction errors (empty bucket → rejected up front); removed the now-dead red Unimplemented variant.
  • Bridge runtime gains enable_all() + tokio net/time so it can drive the S3 HTTP client; Store derives Debug.

Tested

  • Offline construction unit tests: valid config builds + honours the prefix; empty bucket → StoreError::Config. (object_store builds the backend without contacting the endpoint — creds/connectivity resolve on first request.)
  • Full workspace cargo test green; clippy -D warnings + cargo doc -D warnings clean.

Supply chain

The aws feature expands the dep tree (+~570 Cargo.lock lines — http/TLS stack). cargo deny check passes (advisories/bans/licenses/sources ok; only pre-existing duplicate-version warnings).

Deferred (next slice)

Live round-trip (RFC0013.1) + endpoint-override (RFC0013.7) tests run against real S3-compatible storage (Hetzner). The §5 stubs stay #[ignore]d until then; this slice does not change any §5 status.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Introduced Amazon S3 backend support for object storage operations.
    • Added HTTP and S3-compatible endpoint support with configurable regional settings.
    • Implemented validation for S3 bucket configuration to prevent invalid operations.
  • Tests

    • Added comprehensive tests for S3 backend configuration validation and initialization scenarios.

…3 green)

`Store::s3(S3Config)` now builds an `object_store::aws::AmazonS3` (behind the
new `aws` feature) instead of returning a placeholder — AWS S3 or any
S3-compatible endpoint (Hetzner, R2, …) via `S3Config::endpoint`, with
`allow_http` inferred for plain-HTTP dev endpoints. Credentials come from the
standard AWS credential chain (env / profile / IMDS); `S3Config` carries only
non-secret addressing. The backend keeps object_store's default
`S3ConditionalPut::ETagMatch` — the `If-Match` CAS the manifest generation-swap
will use (RFC0013.3/.4). Construction is offline (creds/connectivity resolve on
first request), so it's unit-testable without a live endpoint.

Supporting changes:
- `StoreError::Config` for pre-construction config errors (empty bucket);
  removed the now-dead `red` `Unimplemented` variant.
- Bridge runtime gains `enable_all()` + tokio `net`/`time` features so it can
  drive the S3 HTTP client; `Store` derives `Debug`.
- The `aws` feature expands the dep tree (+~570 Cargo.lock lines, http/TLS
  stack); `cargo deny check` passes (advisories/bans/licenses/sources ok).

Live round-trip / endpoint-override tests (RFC0013.1/.7) land in the next slice
against real S3-compatible storage (Hetzner); the §5 stubs stay `#[ignore]`d.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jensholdgaard, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 10 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5657fef9-2e69-4a8d-8b92-d2d1573d0cb4

📥 Commits

Reviewing files that changed from the base of the PR and between bd5cde8 and 5dc70b1.

📒 Files selected for processing (1)
  • crates/ourios-parquet/src/store.rs
📝 Walkthrough

Walkthrough

Adds real S3 backend support to ourios-parquet's Store. The object_store dependency gains the aws feature, tokio gains net and time, and the shared bridge runtime switches to enable_all(). Store::s3 is implemented using AmazonS3Builder, StoreError::Unimplemented is replaced with Config(String), and unit tests cover both valid construction and empty-bucket rejection.

Changes

S3 Backend for ourios-parquet Store

Layer / File(s) Summary
Cargo features and tokio runtime expansion
crates/ourios-parquet/Cargo.toml, crates/ourios-parquet/src/store.rs
object_store gains the aws feature; tokio gains net and time; bridge_runtime switches to .enable_all() to carry IO and time drivers needed by the S3 client.
Store/S3Config/StoreError type changes
crates/ourios-parquet/src/store.rs
Store derives Debug; S3Config derives Default (empty-bucket sentinel); StoreError removes Unimplemented and adds Config(String) with updated Display and source().
Store::s3 implementation and tests
crates/ourios-parquet/src/store.rs
Store::s3 validates a non-empty bucket, builds AmazonS3 via AmazonS3Builder::from_env(), conditionally permits HTTP, applies optional region/endpoint, and converts cfg.prefix to ObjectPath; new unit tests cover valid construction and empty-bucket rejection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • jensholdgaard/ourios#230: Introduced the Store::s3 stub and Unimplemented error variant that this PR directly replaces with real AmazonS3Builder construction.
  • jensholdgaard/ourios#233: Modified the same sync→async bridge_runtime and StoreError handling in store.rs that this PR further extends with enable_all() and the new Config variant.
  • jensholdgaard/ourios#231: Extended the same Store abstraction in store.rs with local CRUD operations and tests, sharing the same module structure this PR builds on.

Poem

🐇 Hop, hop — the bucket's set and real,
No more "Unimplemented" ordeal!
With aws feature and enable_all,
The S3 builder answers every call.
Config errors caught before they spread,
This rabbit wired the cloud instead! ☁️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing the S3 backend for the Store as part of RFC 0013, which is the primary focus of this PR.
Description check ✅ Passed The description covers the main changes, context (RFC 0013), implementation details, testing approach, and deferred work, closely matching the template structure.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rfc0013-green-s3-backend

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@jensholdgaard
jensholdgaard requested a review from Copilot June 16, 2026 07:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/ourios-parquet/src/store.rs`:
- Around line 216-222: The bucket validation check calls trim().is_empty() to
validate, but the original untrimmed bucket string is then passed to
with_bucket_name on the AmazonS3Builder. This allows whitespace-padded bucket
names to pass validation and cause opaque S3 errors later. Trim the bucket
string first and assign it to a variable, then use this trimmed variable for
both the is_empty() validation check and when passing it to with_bucket_name to
ensure consistent, upfront validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b02b55c-7f28-4a22-934d-210c4e2561dd

📥 Commits

Reviewing files that changed from the base of the PR and between 30a6efc and bd5cde8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • crates/ourios-parquet/Cargo.toml
  • crates/ourios-parquet/src/store.rs

Comment thread crates/ourios-parquet/src/store.rs Outdated

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

Implements the RFC0013 “green” slice for ourios-parquet storage by replacing the S3 placeholder with a real object_store::aws::AmazonS3 backend, enabling the Parquet layer to target AWS S3 or S3-compatible endpoints through a unified Store API.

Changes:

  • Implement Store::s3(S3Config) using AmazonS3Builder::from_env() with optional endpoint/region overrides and upfront config validation.
  • Update the sync→async bridge runtime to enable_all() and expand tokio features to support the S3 HTTP client.
  • Add unit tests for offline S3 store construction and empty-bucket config rejection; update deps (object_store with aws feature).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
crates/ourios-parquet/src/store.rs Adds real S3 backend construction, a new StoreError::Config, updates runtime setup, and introduces S3 construction tests.
crates/ourios-parquet/Cargo.toml Enables object_store’s aws feature and adds tokio net/time features required by the S3 HTTP stack.
Cargo.lock Lockfile updates from enabling the S3/AWS dependency graph.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/ourios-parquet/src/store.rs Outdated
Comment thread crates/ourios-parquet/src/store.rs
Comment thread crates/ourios-parquet/src/store.rs

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

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

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