Repository navigation
Add native AWS store providers - #414
ChristianPavilonis wants to merge 47 commits into
Conversation
5dc18fe to
63892b0
Compare
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Thread replies for the native AWS store review. The PR follow-up comment covers the summary-only points and local verification.
|
Review follow-up: f1f18b8a on top of A few points from the review summaries that don't have their own thread:
Local Linux checks passed: 90 AWS provider tests, 429 default and 430 AWS-enabled Axum library tests, six AWS startup tests, 261 CLI tests serially, both generated loopback proofs, the independent pinned-image emulator suite, and all 16 Node admin/runner tests. Scoped all-feature/all-target Clippy, the SDK isolation check, settings-only Wasm, the all-feature Axum demo build, formatting, docs, and workflow lint passed. No macOS rerun or real AWS calls. Hosted checks for this commit are separate from these local results. |
prk-Jr
left a comment
There was a problem hiding this comment.
PR Review
Summary
Follow-up review at f1f18b8a. Commit f1f18b8a fixes every blocking finding from my earlier review at 3733482f, and I checked each one in the code rather than relying on the thread replies. One new blocker stops this from being approved: the branch no longer merges with its base. issue-397-diagnostics-proxy-trust-spec has moved to 3f6d0da6, and git merge-tree --write-tree reports content conflicts in six files. Because the PR is conflicting, GitHub Actions has not run on this head at all, so none of the new CI steps added here have run in hosted CI.
😃 Praise
- The fixes come with regressions that would catch a revert. As a mutation check, I narrowed
validate_tableback toACTIVE-only, andpreparation_describes_and_accepts_supported_active_and_updating_tablesfailed. - The
run_appandrun_app_with_preflightlocator refusal never reads the locator's value. The test checks that the sentinel path does not appear inDebugoutput. - The new strict-only secret alias check (
validate_local_secret_namespace) is a good answer to the aliasing question. It keeps today's development behaviour, rejects the ambiguous case where startup is strict, and still allows one local ID next to AWS-bound or supplied IDs. - The new CI step uses
run_test_nonzero.shwith named sentinels, so a test that is filtered or cfg'd out fails the step instead of passing with zero tests run.
Prior findings status (my review at 3733482f)
- ✅
run_appignoredEDGEZERO__STORE_BINDINGS_FILE.capture_dev_environmentnow rejects the locator (dev_server.rs:1089), and the demo and the guide userun_generated_app. - ✅ AWS fixtures failed on macOS (
WouldBlock). Every non-blocking accept site now restores blocking mode (dynamodb_tests.rs:150,secrets_manager.rs:462, and the sharedblocking_accept.rshelpers). Locally on macOS,cargo test -p edgezero-store-aws --all-features --libpassed 3 of 3 runs (90/90 each), and--test native_aws_startuppassed 3 of 3 runs. - ✅
UPDATINGtable status was rejected. It is now accepted (dynamodb_kv.rs:672), and the mutation check above confirms the test covers it. - ✅ SDK connectors accumulated under tight limits. The connect timeout is now constant (
dynamodb_kv.rs:616-620), andconnector_timeout_is_stable_while_request_budgets_shrinkcovers it. - ✅ Docs contradicted the code.
single_store_kinds, the missingaws-dynamodb, and the draft and process wording are gone.[limits.aws]is documented atnative-aws-stores.md:204. The Config and Secret Store sections are back, and the absolute-root requirement is stated. - ✅ No CI job ran the axum lib tests with an
aws-*feature. Theaws-stores,aws-dynamodb --libstep now has sentinels. I ran the exact command locally: exit 0, 429 passed. It has not run in hosted CI, as explained below. - ✅ ❓ Local secret IDs shared env variables. Answered and enforced for strict startup and explicit bindings validation (
native_bindings.rs:557,native_stores.rs:285). - ✅ ❓ Container pulls in the required CLI job. Moved to the separate advisory
native-aws-emulatorjob. - ✅ Guide's
config pushcommand could not reach the guard. It now uses the typed<your-app>-cliform. - ✅ Non-blocking items: the trimmed secret name length (now measured with
store_name), the compiled-out AppConfig provider reported as a missing token (token capture is now gated on the feature, and the error names it), the timeout ordering rule and theaws-storeswording (both documented), and the CLI reference flags (added). On fixed trusted bounds for env-selected files, I accept the explanation and the docs; this remains a possible follow-up.
Findings
Blocking
-
🔧 The branch conflicts with its base, so this head has had no hosted CI. Running
git merge-tree --write-tree <base 3f6d0da6> <head f1f18b8a>(merge basec317517c) gives content conflicts in:crates/edgezero-adapter-axum/src/dev_server.rs(10 hunks, including two large runtime/test hunks)run_options.rsservice.rstests/fixtures/production_host.rs(3 hunks)CHANGELOG.mdexamples/app-demo/Cargo.lock
They come from the base's later proxy trust, diagnostics, buffered-JSON and production-hosting review fixes (
48097ab1,64447b46,d37a57b8). The resolution is not mechanical. For example, inrun_options.rsthe env-setting classifier has to keep both this PR's["store_bindings_file"] => STORE_BINDINGS_FILEarm and the base'snative_request_settingfallback (TRUSTED_PROXY_CIDRS,FORWARDING_HEADER_FAMILY,LOGGING__REQUEST_RECORDS). If either is dropped, those settings are misclassified, or the locator is no longer recognised by the runners that now refuse it.Because the PR is
CONFLICTING, GitHub created nopull_requestruns forf1f18b8a: zero check runs on the commit. The last green run is from 2026-11-26, at an earlier head. So the new CI steps (the axumaws-*lib step, the generated native AWS and DynamoDB steps, and the advisory emulator job) have not run on hosted CI.Fix: merge or rebase onto the current
issue-397-diagnostics-proxy-trust-spec, resolve the conflicts so both sides' settings and startup ordering survive, and let the full workflow run green on the new head. I'll re-review the resolution diff.
Non-blocking
- 📝
config validate --adapter <x>without--store-bindingsnow enters bindings-only mode and errors (for--adapter fastly, "supported only for--adapter axum"). This is documented incli-reference.mdand--adapteris new onvalidate, so nothing breaks. It is noted only in case someone expects--adapterto scope ordinary validation, as it does on other subcommands.
CI Status
- Hosted (GitHub Actions) at
f1f18b8a: no runs. The PR is conflicting with its base, sopull_requestworkflows were not triggered. Combined status:pending, 0 contexts. - Local, macOS, at
f1f18b8a, toolchain 1.98.1:cargo fmt --all -- --check: PASScargo clippy -p edgezero-store-aws -p edgezero-adapter-axum -p edgezero-cli --all-targets --all-features -- -D warnings: PASScargo test -p edgezero-store-aws --all-features --lib: PASS 3/3 runs (90 passed each)cargo test -p edgezero-adapter-axum --features aws-stores,aws-dynamodb,test-utils --lib: PASS (430 passed)cargo test -p edgezero-adapter-axum --features aws-stores,test-utils --test native_aws_startup: PASS 3/3 runs (6 passed each)cargo test -p edgezero-adapter-axum --lib(default features): PASS (428 passed)cargo test -p edgezero-cli --lib: PASS (261 passed)- The new CI sentinel step (
run_test_nonzero.sh … --features aws-stores,aws-dynamodb --lib): exit 0
- Not run:
- the full workspace suite
- the WASM checks
- the ignored generated-build proofs
- the Docker emulator suite
- anything against real AWS
- Not re-read line by line in this pass: the lockfiles and the
docs/superpowersplan and spec files. Unchanged production code that I already reviewed at3733482fwas not re-read either; this pass focused on the3733482f..f1f18b8adelta and the touched production paths.
| } | ||
| if !matches!( | ||
| table.table_status(), | ||
| Some(TableStatus::Active | TableStatus::Updating) |
There was a problem hiding this comment.
😃 Using the typed TableStatus enum here is cleaner than the old string compare, and the regression really guards this line: narrowing it back to Some(TableStatus::Active) makes preparation_describes_and_accepts_supported_active_and_updating_tables fail.
| } | ||
| } | ||
|
|
||
| fn timeout_policy(limits: DynamoDbKvLimits, budget: Duration) -> TimeoutConfig { |
There was a problem hiding this comment.
😃 Holding the connect timeout constant while the attempt and operation timeouts still shrink with the budget fixes the connector cache growth without loosening any deadline. The comment explains why, which will stop someone "optimising" it back later.
| let Some(key) = os_key.to_str() else { | ||
| continue; | ||
| }; | ||
| if is_store_bindings_locator_key(key) { |
There was a problem hiding this comment.
😃 Failing closed here before any store opens, without ever reading the locator's value, is the right shape. 📝 When you resolve the base conflict, keep this check: dev_server.rs has 10 conflict hunks against the current base, and this one sits in the same capture_dev_environment loop the base also changed.
Bring in PR #409's proxy trust and diagnostics review fixes, PR #407's buffered JSON limit fixes and PR #406's production hosting review fixes (RunMode with standalone and embedded hosting, typed KV open and config snapshot failure categories, store normalization in PreparedStores), with PR #460's and PR #275's fixes below them. CHANGELOG.md: both sides added an Unreleased section at the top. The resolution keeps PR #409's "Axum diagnostics and proxy trust" section first and this PR's "Native AWS stores on Axum" section after it. crates/edgezero-adapter-axum/src/dev_server.rs: PR #406 replaced the signals flag with RunMode, initializes the logger only for standalone production runs, moved config limit parsing out of build_production_stores, switched to KvOpenFailure and ConfigStoreError::category, and normalizes bare handles in From<Stores>. This PR added NativeStoreOverrides, NativeSourcePlan validation, async build_production_stores, run_generated_app, run_production_app_with_options_and_initializer and run_app_with_native_stores. The resolution threads both overrides and RunMode through run_production_selected. The run_production_* entry points are standalone, and run_app_with_options* and run_app_with_native_stores are embedded. NativeSourcePlan validation runs first, then the standalone-only logger, then PR #406's "configure: application: assembly failed" error. NativeSourcePlan keeps carrying the config limits, so store-free apps still reject invalid limits. The local config and KV sources use PR #406's open call and failure categories. Local KV keeps the "KV" subject, which PR #406's production_hosting test pins. From<Stores> keeps PR #406's body. This PR's dev runner refusal of the bindings locator is kept next to PR #406's native_request_setting lookup. This PR's strict-managed, strict-installed and strict-owned logging probes called the embedded run_app_with_options, but under PR #406 an embedded run leaves the logger to the host. They now call this PR's standalone run_production_app_with_options_and_initializer, which owns the logger. strict-invalid-sources stays on run_app_with_native_stores. It still proves that source validation runs before any deferred setup, but on an embedded run it no longer orders validation before logger setup. PR #406 also removed the file-level ordering expect. This PR's four new tests in mod tests move below the fixture types, and native_store_tests gets a scoped arbitrary_source_item_ordering expect. crates/edgezero-adapter-axum/src/service.rs: PR #406 removed the service's bare-handle fields and setters. This PR had moved the same fallback into resolved_store_registries and legacy_* helpers, and added a setter-order test for them. The resolution takes PR #406's file. The registry-precedence check in both setter orders survives in this PR's dev_server test prepared_stores_preserve_legacy_defaults_and_explicit_registry_precedence. crates/edgezero-adapter-axum/src/run_options.rs: fixed_setting keeps this PR's STORE_BINDINGS_FILE arm and PR #409's native_request_setting fallback. crates/edgezero-adapter-axum/tests/fixtures/production_host.rs: the resolution keeps both import sets, this PR's run_explicit_initializer_fixture, PR #406's legacy_server, repeated_embedding_logging and embedded_server, and PR #406's main dispatch. It adds this PR's "explicit-initializer" mode to that dispatch. Cargo.lock and examples/app-demo/Cargo.lock: the resolution takes PR #409's lockfiles and re-resolves them offline, which adds this PR's AWS SDK graph. cargo update --precise then sets the AWS-only crates back to this PR's versions: arc-swap, aws-smithy-async, aws-smithy-runtime-api-macros, aws-smithy-types, ctutils, h2, tokio-util and uuid in the root, and aws-smithy-types and h2 in app-demo.
Bring in PR #439's native Geo sanitization fixes (a supplied provider behind an untrusted forwarding policy) and the review fixes below it, from PR #422 down to PR #275, including RunMode hosting, native_request_setting, the development runner's refusal of the bindings locator, the ForwardedHost note in the Fastly guide and DEFAULT_SHUTDOWN_GRACE. crates/edgezero-adapter-axum/src/run_options.rs: the defaults keep this PR's optional manifest Geo (geo: None) and the base's DEFAULT_SHUTDOWN_GRACE. fixed_setting checks this PR's geo_setting first, then the base's native_limit_setting and native_request_setting. crates/edgezero-adapter-axum/src/dev_server.rs: the imports keep this PR's geo_setting and the base's native_request_setting. The base made shutdown_grace private and no longer uses it here, so its import is dropped. capture_dev_environment keeps PR #414's refusal of the bindings locator and the base's native_request_setting lookup, and adds this PR's geo_setting as the last fallback. crates/edgezero-adapter-axum/tests/fixtures/production_host.rs: run_geo_fixture keeps this PR's geo-manifest branch (options from the environment and the baked manifest). In the explicit branch it adds PR #439's untrusted X-Forwarded policy for geo-supplied-untrusted. docs/guide/adapters/fastly.md: the resolution keeps PR #409's ForwardedHost paragraph at the end of the preceding section and this PR's new "Geographic context" section after it.
|
Round 12 identity realignment:
#406's RunMode and this PR's native store overrides now run through one startup function, #406's removal of the service handle setters is taken, and the strict-logging probes move to the standalone entrypoint. AWS-only lock entries are pinned back to this PR's versions. Each merge message says what it carries and how any conflict was resolved. |
|
Round 15 identity realignment:
Each merge message says what it carries and how any conflict was resolved. |
SDK DEBUG/TRACE records carry DynamoDB request and response bodies, so EDGEZERO__LOGGING__LEVEL=trace must not reach them; applications that own logging keep full control.
Axum accepts multiple secrets IDs; only implicit local IDs, which share one environment namespace, are limited to one.
The proofs set EDGEZERO__DATA_DIR, which the runner never reads, so the directory could never exist. DATA_DIR stays unset; any local KV open already fails strict startup.
Removing consistent_read or moving the prefix into a FilterExpression passed every existing test; DynamoDB Local is always consistent.
… more The old test ended on a success at the third attempt and ran with AWS_MAX_ATTEMPTS=3, so a higher or missing cap still passed.
Review follow-up: fixes committed to this branchA full review of this PR turned up the problems below; each would otherwise have needed a follow-up ticket, so it is fixed on this branch instead. Every item names its commit.
Fixes made on the PRs below this one in the stack were merged into this branch with merge commits. One merge carried an adjustment: c5f57b0 adds |
Current review readiness
Ready for review. Required current-head CI passed at
c66f93f118141a2ed7469a8ab96b12902f3854e6: test run 42924131967.Minimal fixes originate in #414 and are merged upward:
Deadline; non-timeouts remainUnavailable. The previously failing hosted timeout test and all 78 provider cases now pass without assertion, retry or duration changes.aws-types =1.6.0andaws-smithy-runtime-api =1.19.0. This prevents the schema mismatch and preserves the explicit older behavior version instead of switching retry policy or suppressing deprecations. A fresh consumer passes with compiler and Clippy warnings denied throughout.Local final-top Axum checks pass 488 unit, 28 contract, six AWS startup, four celld startup and 36 hosting cases. Final-top workspace strict Clippy and formatting pass. The prior stable checkpoint passed all six mandatory commands; unchanged inputs retain their receipts, while fresh current-head CI checks the combined state. The current ready state supersedes historical draft-only prerequisites below; unexecuted deployment acceptance is not claimed complete. An additional Fastly WASM runtime job was still running at transition and is not counted as passed. No TS work or deployment qualification is a review prerequisite. Integration #462 remains draft; reviewers
aram356,prk-Jranddhruv8shremain requested. Stack465 and PR bases are unchanged; #453 is excluded.Current review-stack checkpoint
Publication head:
c66f93f118141a2ed7469a8ab96b12902f3854e6. This cleanup preserves the existing feature unit and PR identity. The additional change is the completed generated-native build correction: image-only code now follows the scaffold's existing Fastly-example selection, with no request-policy change. Its focused generator/native proof is retained; fresh per-branch hosted checks are not assumed green.Review order: #275 → #406 → #407 → #409 → #414 → #422 → #439 → #454. Draft integration checkpoint: #462. New SDK/group/codec/phase development and unrelated TS work are not prerequisites or additions to this PR. Earlier notes below retain their original tested revisions and limits; they are not a whole-tree pass for this new head.
Earlier implementation and proof notes
RC refresh checkpoint, 2026-11-10
Current head:
48761e3e528eae0481e9f6e2eb30c0002f00d239.Only the AWS provider delta is replayed onto the updated hosting/diagnostic stack. Duplicate historical foundation/hosting commits are omitted. Explicit production options and initializer startup have a TCP no-ambient-merge regression. Ordinary test PR coverage remains unfiltered; an old donor filter was removed again.
Feature proof passes 417 Axum unit, 5 AWS startup, 33 hosting, 74 AWS provider, 256 CLI unit and 15 Node runner cases, scoped strict Clippy and SDK-isolation checks. Parent namespace/CI composition reruns pass all 5 AWS startup, 33 hosting and 35 Node CI cases. All five tracked locked fetches pass.
Generated native consumer/DynamoDB and pinned disposable-service runtime proofs are still pending integration execution. Bounded retained SDK values are not an RSS cap; timeout cancellation does not prove blocking credential work stopped. AWS clients intentionally retain their normal credential chain, separate from explicit hosting-source selection. No cloud acceptance is claimed.
Draft pending fresh hosted checks and the combined RC audit. Two unchanged native default-parallel deadline misses remain recorded and unclassified; serial passes and untouched-foundation parallel passes do not clear them. No timing bound was relaxed. No deployment, main merge, security-alert dismissal or review-thread resolution occurred. Historical design/review context follows.
Summary
Sendsetup futures.Design and boundaries
This adds native store providers, not a new HTTP runtime.
edgezero-store-awsimplements the existing core store traits and does not depend on Axum. Axum owns provider selection and startup composition; core owns portable handles, per-ID registries and typed configuration resolution.The portable
edgezero.tomldeclares logical store IDs and defaults. AWS resource references belong in a separate versioned native bindings document, selected through an absolute file path inEDGEZERO__STORE_BINDINGS_FILEor through explicitAxumRunOptions. Applications can also supply ready handles or non-Senddeferred setup, without a plugin registry.Each declared ID selects one supplied, explicitly bound or implicit local source. Supplied/file collisions and undeclared IDs are rejected. The runner validates all sources before opening runner-owned local stores or polling deferred setup.
CONFIG_DIR/DATA_DIRare required only for remaining local bindings. An unavailable selected provider fails startup; it never falls back to local data.ConfigStorereadsSecretStorereadsKvStoreoperationsflowchart TD Bindings[Bindings and supplied inputs] --> Validate[Validate sources and compiled providers] Validate --> Prepare[Assemble app and prepare stores in the native runtime] Prepare --> Registries[Complete per-ID registries] Registries --> Initialize[Run app-owned initializer when supplied] Initialize --> Serve[Bind listener and serve requests]One shared AWS preparation session owns startup budgets, client reuse and snapshot deduplication. The initializer receives the same registries used by requests. The application chooses its required config keys, schemas, secret checks and retained startup state; the framework does not infer those requirements or promise an atomic revision across remote resources.
AWS features are default-off and native-only. Existing entrypoints retain their local defaults; newly generated entrypoints select strict startup only when the bindings-file locator is present. Trusted Server adoption is separate work, and this does not claim a source-compatible upgrade from older EdgeZero versions across the #275/#406 prerequisites.
Stack and scope
Existing draft stack member based on
docs/outbound-http-spec/ #275 atea66eff045512cccc60646d6ec339e83ff44fed7, with the compatible #406 production lifecycle bridge. Neither prerequisite PR was rewritten or merged. The user approved adding DynamoDB on this same branch/PR and committing/pushing it after checks.Real AWS/IAM/capacity/deployment/image acceptance remains explicitly excluded. No real AWS service calls, infrastructure changes, image pulls or deployments were performed. SDK fixtures use dummy credentials, isolated or bypassed profile discovery, and literal-loopback endpoints.
DynamoDB KV
dynamodb-kvprovider / generatedaws-dynamodbfeature; existingaws-storesremains AppConfig Agent + Secrets Manager only.[kv.<id>]binding with explicit region/table/physical namespace, no credential or endpoint fields. Normal operator-owned SDK credential/endpoint policy remains supported.pk/sktable; bounded DescribeTable preflight, exact table-name/schema checking, no provisioning or local fallback. All-remote KV needs noDATA_DIR.DynamoDB is live storage, not a retained startup snapshot. The existing default 8 MiB retained-payload cap is per shared config/secret preparation session, not process/RSS or live database contents. Config/secrets still adopt remote changes only on restart; no live config/secret refresh or mutation is added.
Bindings validation remains structural-only / provider availability unknown. No offline Cargo resolver or guessed availability verdict is shipped. Custom shell actions remain untouched.
Verification
Original snapshot phase: all 24 post-rebase gates passed at its recorded source checkpoint; historical evidence remains in the original spec/plan and
/tmp/native-store-integration/final-checks/. This does not claim those old results prove the later DynamoDB edits.DynamoDB extension: 20 code gates plus docs lint/full-format/build passed, against an archived exact staged source tree independent of eight pre-existing dirty files. SHA-256 input manifests matched; later publication-record edits are Markdown-only.
aws-storesmembership, Cloudflare/Fastly/Spin WASM checks.Unavailable, one attempt and the retained/removed row. SDK model Debug disclosure is directly asserted.Senddeferred source validation without polling/opening another local store; existing generic native staging atomicity/drop tests preserved.edgezero serveinvocation; shared argument/action selection has unit/source proof, generated build and startup are executed.An inherited Secrets timeout test transiently returned
Unavailableinstead ofDeadlineunder the combined parallel run. It passed alone, then all 74 provider tests passed serially. The initial failure log is retained; no production/unrelated test was changed to hide it.Commands/fingerprints:
/tmp/dynamodb-baseline/final-checks.sh,/tmp/dynamodb-baseline/final/,snapshot-{before,after}.sha256; checked source tree2fa76fb26377cf41203c255f924d988d6b657002. Final read-only provider review found no confirmed defects and is separate from executed checks.Closes
Closes #410
Checklist
Sendsetup preservedFixture lifetime follow-up
Commit
e9181716975c068cd6894e046eec1ee3e194ad69keeps the loopback endpoint alive until its SDK child completes. A local reproduction of the hosted timeout failure identified a genuine ConnectionRefused after the one-response worker dropped its listener while the SDK still owned retries. The deterministic endpoint-lifetime regression fails before this fix. All 79 AWS tests, strict all-feature/all-target AWS Clippy, and 30 repetitions of the original timeout test pass afterward. This changes only the test fixture. Production timeout limits, retry policy and typed error classification are unchanged. Current-head hosted qualification is running; no release tag is claimed.Owned follow-up review checkpoint
4adeb228ebcc0839f5306e16be6ea9b963e97f36. Source tree224f1f81634a5871a05b569939b13a4f02606b0dis byte-identical to previous head3733482f6bedcaecb162b1e927209f3800f8b388.