Repository navigation
Commit 683202c
authored
Add opt-in reusable application lifecycles (#379)
* feat: add opt-in reusable application lifecycles
Add retained Fastly serving helpers and explicit prebuilt-app dispatch for Cloudflare and Spin while preserving default lifecycles. Preserve repeated Cloudflare response headers.
Add Rust lifecycle fixtures, isolation and cancellation coverage, local measurement tooling, CI integration, and adapter documentation with explicit provider validation limits.
* fix: import dispatch types for WASM Clippy
* test: preserve lifecycle smoke failure diagnostics
* Complete custom lifecycle contract and scope config validation
Verify lazy initialization, handled failure, recovery and retained reuse in one Fastly guest. Carry request-specific finalization metadata through router dispatch and document the supported custom lifecycle boundary.
Scope push and diff adapter validation to the selected destination while preserving standalone portability checks. Redact raw and normalized secret references from Spin diagnostics.
Validated with workspace and fixture tests, Clippy, formatting, adapter feature checks, Spin WASM compilation, documentation checks and the local Fastly smoke suite.
* Add reusable lifecycle helpers for custom Fastly dispatch
Own successful-only lazy state retention, initialization attempts, callback counts, and independent setup in Sandbox<T>. Add reusable and single-request serving wrappers that preserve the SDK sending boundary and application-controlled streaming.
Migrate custom lifecycle fixtures to the public helpers and document ownership across adapters. Verified workspace tests, fixture tests, Clippy, adapter compilation checks, formatting, and local Fastly streaming and recovery smoke tests.
* Cover Cloudflare response headers and clarify lifecycle contracts
Extract the production header-copy logic for host regression tests covering duplicate cookies, default replacement, invalid values, and sink errors. Exercise prebuilt dispatch with fresh request bodies in the Cloudflare browser contract suite.
Document store metadata pairing, retained callback captures, and first-snapshot logging limitations without changing existing policies.
* Fix Cloudflare contract test import for WASM Clippy
* fix: match selected adapter case-insensitively in config validation
Adapter lookup is case-insensitive everywhere else (Manifest::adapter_entry,
adapter_registry::get_adapter), but the --adapter selection filters in
run_adapter_shared_checks, run_adapter_typed_checks, and
strict_capability_completeness compared raw strings. So [adapters.Spin] with
--adapter spin (or the reverse) passed ensure_adapter_defined but skipped the
selected entry's manifest, merged-store, typed-secret, and store-capability
checks, letting config push write invalid configuration that fails at runtime.
Extract is_unselected_adapter and compare with eq_ignore_ascii_case at all
three filters. Add a regression test covering both casing directions.
* fix: address reusable app lifecycle review findings
* fix: address follow-up lifecycle review findings
Docs:
- Fastly guide: add a complete serve_custom skeleton, state precise error
semantics, use app.router(), avoid echoing setup errors to clients,
clarify request vs callback wording, billing and Viceroy caveats.
- Correct streaming, cloudflare, overview, spin, axum, handlers,
configuration and cli-reference wording; document what --adapter skips.
- Trim the fixture README to commands, assertions and limits; move notes
into the spec. Drop the removed --require-runtime flag from the plan.
- CI: skip the duplicate fastly fixture clippy on the "fastly cli" row.
Fixtures:
- Custom Fastly dispatch installs its logger via Sandbox::setup_once and
joins the logging checks; gate post-send work on the streaming route.
- Share MissingBindingApp and the loopback check in fixture-core; map
missing bindings to EdgeError::internal without unwraps.
- Remove dead max_inflight and configures outputs; route /other through
run_app in per-request mode; Spin logger parity and ~6.0 pin.
Harness:
- Kill live runtime process groups on Ctrl-C (ctrlc crate).
- Record Viceroy version mismatch as unverified and keep running.
- Single contextual fail record per failure, including startup failures,
with a phase field; fail record for mixed build fingerprints.
- Serve and fingerprint artifacts copied into the run directory.
- Extract settle/cohort_stats helpers; resolve rustc next to $CARGO.
* fix: tighten follow-up review fixes after self-review
- Custom Fastly fixture: log logger-setup failures to stderr and send a
bare 503 instead of echoing the error, matching the guide.
- Harness: only skip the generic fail record when a runner already
recorded the same error, so an earlier non-fatal failure cannot hide it.
- Docs: ServeSummary may be inspected or converted; list EdgeError render
failure among terminal errors (guide and serve_app rustdoc); push keeps
strict handler-path checks under --adapter; app.router() in rustdoc;
qualify the heap-snapshot and setup-once README claims.
* docs: polish lifecycle review fixes after re-review
- Drop the stale spin.toml copy from the run directory; the served
manifest is the rewritten spin-<mode>.toml pointing at staged wasm.
- README: note that runtimes serve and fingerprint staged artifact copies.
- Plan: exit 2 covers unverified or unsupported evidence.
- CLI reference: fix push --adapter sentence grammar.1 parent 9893091 commit 683202c
65 files changed
Lines changed: 9875 additions & 90 deletions
File tree
- .github/workflows
- crates
- edgezero-adapter-cloudflare
- src
- tests
- edgezero-adapter-fastly
- src
- tests
- edgezero-adapter-spin/src
- edgezero-cli/src
- edgezero-core/src
- docs
- guide
- adapters
- superpowers
- plans
- specs
- examples/app-demo/crates/app-demo-core/src
- scripts
- tests/fixtures/reusable-app
- crates
- fixture-axum
- src
- fixture-cloudflare
- src
- fixture-core
- src
- fixture-fastly
- src
- bin
- fixture-harness
- src
- fixture-spin
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
| 118 | + | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
| |||
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
| 144 | + | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
| |||
247 | 256 | | |
248 | 257 | | |
249 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
250 | 273 | | |
251 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
109 | 133 | | |
110 | 134 | | |
111 | | - | |
112 | 135 | | |
113 | | - | |
| 136 | + | |
114 | 137 | | |
115 | 138 | | |
116 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
153 | 179 | | |
154 | 180 | | |
155 | 181 | | |
| |||
0 commit comments