Repository navigation
Conversation
dhruv8sh
left a comment
There was a problem hiding this comment.
PR Review
Summary
config push and config diff now reject --runtime-config for every adapter except Spin. The check runs at the start of both typed library entrypoints, before any manifest access, I/O, or provider command. Help text and docs now separate Spin's host runtime settings from the app-config payload. The change is small, well tested, and covers the whole #458 checklist. Approving; the items below are non-blocking.
😃 Praise
- 😃 The check is placed where it can't be bypassed (
crates/edgezero-cli/src/config.rs:456,:615). It's the first statement of bothrun_config_push_typedandrun_config_diff_typed, so library callers, generated CLIs, and the demo all get it without duplicating it. - 😃 Tests prove nothing reaches a provider (
crates/edgezero-cli/src/config.rs:2775,:2818). Failing, op-logging fakefastly/wrangler/spinbinaries on PATH show no calls, no.edgezerostate, and no runtime-file changes. Spin's explicit and default paths are covered with and without--local, including a mixed-case adapter name. - 😃 Docs clearly separate host runtime settings from the app-config payload (
docs/guide/cli-reference.md:396,:469).
Findings
Non-blocking
- 🤔 Hardcoded adapter name in the shared CLI (
crates/edgezero-cli/src/config.rs:1358).validate_runtime_config_adapterbranches onadapter.eq_ignore_ascii_case("spin"). The same file says at line 1612:No `if adapter == "spin"` branches here.- It also means an out-of-tree adapter can never receive
AdapterPushContext::runtime_config_path, which the public registry documents as a generic hook (crates/edgezero-adapter/src/registry.rs:193-199). - Fix: add a capability method so the rule lives in one place and the early ordering is kept (
get_adapterdoesn't need the manifest):If you'd rather keep this PR minimal, a comment at line 1358 explaining the exception is enough.// trait Adapter fn accepts_runtime_config(&self) -> bool { false } // edgezero-adapter-spin: override to return true // config.rs if runtime_config.is_some() && !adapter_registry::get_adapter(adapter).is_some_and(|a| a.accepts_runtime_config()) { /* error */ }
- ⛏ Misleading error for an unknown or typo'd adapter (
crates/edgezero-cli/src/config.rs:1359).--adapter spn --runtime-config xreports "only supported with --adapter spin" instead of "not configured". Consider naming the adapter:format!("--runtime-config is only supported with --adapter spin (got `--adapter {adapter}`)"). If so, update the assertions atconfig.rs:2762,generated_project_builds.rs:78, andconfig_flow.rs:370. - 📝 The help test only checks long help (
crates/edgezero-cli/src/args.rs:560-566). The short-hcurrently shows the same "Spin only" text, so nothing is wrong today. This only matters if a paragraph break is added later.
CI Status
Run locally on the pinned Rust 1.98.1:
- fmt: PASS
- clippy: PASS
- tests: PASS
- check
--features "fastly cloudflare spin": PASS - spin
wasm32-wasip2check: PASS
ChristianPavilonis
left a comment
There was a problem hiding this comment.
😃 The shared validation at crates/edgezero-cli/src/config.rs:456 and :615 rejects unsupported options before file/provider access. Regression coverage exercises mixed-case adapters, local/dry-run combinations, and explicit/default Spin paths. No new actionable findings; all required local checks and supplementary verification passed.
Summary
--runtime-configfor non-Spinconfig pushandconfig diffbefore configuration-file access or provider activity, so unsupported options cannot silently succeed.--app-config.Changes
edgezero-cli/src/config.rsedgezero-cli/src/args.rsedgezero-cli/tests/generated_project_builds.rsexamples/app-demo/crates/app-demo-cli/tests/config_flow.rsdocs/guide/cli-reference.mdCloses
Closes #458
Test plan
Historical author-reported local verification below (original head unrecorded unless an explicit SHA is given). These results, counts, timings and negative controls were not rerun in this audit, and their underlying local logs were unavailable; checked boxes retain the original report. At the current head
1095f9d6, all 28 reported hosted checks are passing.Local verification completed before publication using Rust 1.98.1 and Node 24.20.0. The PR is now non-draft; current reported hosted checks are passing.
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-demofull workspace testsedgezero serve --adapter axumconfig_flowtests; explicit generated-project host and all three WASM compilation checks; Spinwasm32-wasip2check; demo formatting; docs ESLint and Prettier.The initial sandbox socket/DNS restrictions and disk-space failures were resolved before successful reruns. Workspace socket tests ran outside the sandbox; generated-project verification ran offline with cached dependencies. No live provider operation was performed.
Checklist
{id}syntax (not:id)edgezero_core(nothttpcrate)KvRegistry/ConfigRegistry/SecretRegistry(not the legacy single-handle setters)