feat(server): rfc0019 green .1/.6/.7 — StoreConfig seam + backend selection - #289
Conversation
…ection
Add `StoreConfig { Local(PathBuf) | S3(S3Config) }` + `open()` to
ourios-parquet (next to Store/S3Config), and resolve it in ourios-server from
`OURIOS_STORAGE_BACKEND` (local default | s3) + `OURIOS_BUCKET_ROOT` /
`OURIOS_S3_{BUCKET,ENDPOINT,REGION,PREFIX}`. Credentials are never read here —
they come from the AWS chain inside `StoreConfig::open` (RFC 0019 §3.4), so a
resolution error names only the missing key, never a secret.
ServerConfig now carries `store: StoreConfig` instead of a bare `bucket_root`.
The receiver/compactor/querier still address the store as a local path, so
`main()` extracts the path for the local backend and fails fast on s3 with a
clear "role wiring lands in a later slice" message — the S3 data path arrives
when the querier/compactor are migrated onto `Store` (RFC0019.3/.4, §3.3).
Greens the config-layer scenarios as unit tests in main.rs (private fns):
RFC0019.1 (selection + fail-fast), .6 (no secret leakage), .7 (local default
unchanged). The S3 server-level scenarios (.2/.3/.4/.5) stay red stubs. Adds
PartialEq/Eq to S3Config + StoreConfig so ServerConfig keeps its derive.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 22 minutes and 49 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 To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIntroduces a ChangesStoreConfig backend abstraction and server wiring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Implements RFC 0019 “green slice 1” by introducing a StoreConfig seam (local vs S3) and wiring ourios-server to resolve the selected backend from OURIOS_* env vars, while intentionally failing fast at runtime if s3 is selected (until later slices migrate roles onto Store).
Changes:
- Added
StoreConfig { Local(PathBuf) | S3(S3Config) }toourios-parquetand re-exported it. - Updated
ourios-serverconfig resolution to build and carryStoreConfig, plus added unit tests for RFC0019 scenarios.1/.6/.7. - Adjusted RFC0019 integration test stubs to keep only the remaining server-level ignored scenarios
.2–.5.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| crates/ourios-server/tests/rfc0019_storage_backend.rs | Updates RFC0019 server-level scenario stubs; removes scenarios now covered by unit tests. |
| crates/ourios-server/src/main.rs | Adds backend selection/config parsing into StoreConfig, adds fail-fast for S3 runtime, and adds unit tests for RFC0019 .1/.6/.7. |
| crates/ourios-parquet/src/store.rs | Introduces StoreConfig and adds PartialEq/Eq to S3Config to support comparisons/tests. |
| crates/ourios-parquet/src/lib.rs | Re-exports StoreConfig from the store module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
) - build_store_config trims OURIOS_STORAGE_BACKEND and treats empty as unset, so " s3 " selects S3 and a blank value falls back to local (not "unknown"). Covered by the RFC0019.1 unit test. - Tighten the secret-hygiene rustdoc: an error for a *missing required* value names only the key; other errors (unknown backend) may echo the non-secret value for diagnosability (matches RFC 0019 §3.4). - Document StoreConfig's deliberate exhaustiveness + why the #[non_exhaustive] semver tradeoff doesn't apply (all crates are publish=false / internal). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
) build_store_config now reports an unset bucket root ("must be set") distinctly from a present-but-empty one ("must not be empty") for clearer operator diagnostics, restoring the two-message split the refactor had merged. RFC0019.1 asserts both messages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
What
RFC 0019 green slice 1: the
StoreConfigseam + storage-backend selection from config. Greens the config-layer scenarios.1/.6/.7; the S3 server-level scenarios (.2/.3/.4/.5) stay red until the querier/compactor are migrated ontoStore(slice 2/3).How
ourios-parquet:StoreConfig { Local(PathBuf) | S3(S3Config) }+open() -> Result<Store, StoreError>(next toStore/S3Config). Exhaustive enum on purpose — adding a backend should force every consumer to handle it.PartialEq/Eqadded toS3Config+StoreConfig.ourios-server:build_store_config(...)resolvesOURIOS_STORAGE_BACKEND(localdefault |s3) +OURIOS_BUCKET_ROOT/OURIOS_S3_{BUCKET,ENDPOINT,REGION,PREFIX}.ServerConfignow carriesstore: StoreConfig. Credentials are never read in config resolution — they come from the AWS chain insideStoreConfig::open(RFC 0019 §3.4), so a resolution error names only the missing key.main()extracts the local path for thelocalbackend; fors3it fails fast with a clear "role wiring lands in a later RFC 0019 slice" message (the receiver/compactor/querier still address a local path until slice 2/3, §3.3). The default local path is byte-for-byte unchanged.Tests
.1/.6/.7are unit tests insrc/main.rs(they exercise the privatebuild_store_config/build_config): selection + fail-fast on missing bucket / unknown backend (.1); missing-S3-config error names only the key, no credential leakage (.6); the default local path resolves unchanged (.7). The integration stub file keeps.2–.5ignored.cargo clippy -p ourios-parquet -p ourios-server --all-targets --all-features -- -D warningsclean; the existing receiver/querier/served-binary suites pass (they use the local default);cargo fmt --all --checkgreen.Note
This is env-var config, consistent with the rest of the server (compaction/receiver/querier are all
OURIOS_*env). Whether to add a YAML config file is a separate, cross-cutting decision I'm raising with the maintainer (would be an RFC 0004 amendment); it wouldn't change thisStoreConfigresolution, only its input source.Next
Slice 2: migrate the querier + compactor onto the
Storelisting wrapper (§3.3), then slice 3: localstack e2e (.2/.3/.4/.5) → flip RFC 0019 green.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
OURIOS_STORAGE_BACKEND(defaults to local; supports S3).OURIOS_BUCKET_ROOT) and S3 (e.g., bucket plus optional endpoint/region/prefix), with stricter validation.Chores
Tests