Move chunked_config to edgezero-core and export it#302
Open
prk-Jr wants to merge 1 commit into
Open
Conversation
The Fastly chunk-pointer writer and resolver are pure functions (I/O is delegated to caller-supplied callbacks), but lived crate-private inside edgezero-adapter-fastly. Downstream hosts that read Fastly-shaped config stores through their own store abstractions could not reuse them and had to re-implement the wire format (pointer schema, per-chunk len + sha verification, envelope reassembly). Move the module to edgezero-core, make its API pub, and keep edgezero-adapter-fastly compiling unchanged via a pub(crate) re-export. No behavior change; the module's tests move with it.
aram356
requested changes
Jul 2, 2026
| @@ -5,6 +5,12 @@ | |||
| //! module splits the envelope into content-addressed chunk entries plus a | |||
Contributor
There was a problem hiding this comment.
We should not have adapter specific code in the core. Maybe we can do this differently
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.
Summary
chunked_config) by moving it fromedgezero-adapter-fastly(where it waspub(crate)) intoedgezero-core, next to its only dependencyblob_envelope.trusted-servercarries a ~150-line copy of the resolver today because it must classify chunk read failures (retryable → 503) separately from verification failures (terminal → 500) at its own error boundary; the callback-based resolver expresses that, the transparentFastlyConfigStore::getpath cannot.edgezero-adapter-fastlykeeps compiling unchanged via apub(crate)re-export.Changes
crates/edgezero-core/src/chunked_config.rsedgezero-adapter-fastly; API madepub(+#[inline]per strict-clippy);cli-feature cfg gates dropped (core has noclifeature; unused pure fns strip at link); module doc explains why it lives in core; all 13 unit tests move with itcrates/edgezero-core/src/lib.rspub mod chunked_config;crates/edgezero-adapter-fastly/src/lib.rspub(crate) mod chunked_config;→pub(crate) use edgezero_core::chunked_config;gatedany(cli, fastly, test), placed in the import group perarbitrary_source_item_orderingCloses
n/a — issue linking skipped by request.
Test plan
cargo test --workspace --all-targetscargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkcargo check --workspace --all-targets --features "fastly cloudflare spin"wasm32-wasip1(Fastly) /wasm32-wasip2(Spin) /wasm32-unknown-unknown(Cloudflare)examples/app-demoworkspace:cd examples/app-demo && cargo test --workspace --all-targetscd docs && npm run lint && npm run format && npm run buildedgezero serve --adapter axumtrusted-serverpatched to this branch with its local resolver replaced byedgezero_core::chunked_config::resolve_fastly_config_value; full suite green (1475 core + 144 adapter tests) including the 503-vs-500 classification tests that motivated the local copyChecklist
{id}syntax (not:id) — n/a, no routing changesedgezero_core(nothttpcrate)KvRegistry/ConfigRegistry/SecretRegistry— n/a, no store wiring changes