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.
|
Addressed the review-body feedback in 2f7f7f94. The shared validation now explains the current Spin-only option policy and reports the supplied adapter, including typos, before any file or provider access. Short and long help are both checked; library, generated CLI and demo assertions require the adapter-specific message. Spin acceptance/path forwarding is preserved. The strengthened regression failed on the old diagnostic and passes with the correction. All five required local Rust gates, demo checks, generated-project host/three-WASM checks, and docs lint/format passed on the pinned tools. The commit is GitHub Verified. Hosted CI for the new revision is pending; the description now distinguishes this from the older green head. There are no inline threads to resolve. |
|
The actual CodeQL sink is corrected in db7ba09c. The manifest-loading fallback assertion no longer formats the returned diagnostic on failure; its Production behavior and all regression conditions are unchanged. All five required local Rust gates passed on Rust 1.98.1; the commit is GitHub Verified. All 29 hosted checks now pass on |
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 previous head
1095f9d6, 29 reported hosted checks passed. That result is historical and does not verify a later commit.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)Review follow-up
The CLI now explains its current Spin-only runtime-config policy and names the supplied adapter in rejection messages. Library, generated CLI and demo regressions require that adapter-specific diagnostic; short and long help are checked. Assertion failure text no longer prints returned diagnostics, including the fallback line identified by CodeQL. Production rejection ordering and accepted Spin paths are preserved.
At
db7ba09c, all five required local Rust gates pass using Rust 1.98.1 (debug information disabled to bound storage). The earlier review fix also passed demo config-flow/format/Clippy, generated host/three-WASM checks, and docs lint/format; those areas are unchanged by the test-message-only follow-ups. The new commit is GitHub Verified. All 29 hosted checks now pass ondb7ba09c. The processed Rust CodeQL analysis is error/warning-free with zero findings across 27 rules; the cited alert(s) are fixed.