Skip to content

Remove legacy entry point, canary routing, and flag plumbing#744

Open
prk-Jr wants to merge 13 commits into
feature/edgezero-pr19-cutover-canaryfrom
feature/edgezero-pr20-legacy-cleanup
Open

Remove legacy entry point, canary routing, and flag plumbing#744
prk-Jr wants to merge 13 commits into
feature/edgezero-pr19-cutover-canaryfrom
feature/edgezero-pr20-legacy-cleanup

Conversation

@prk-Jr
Copy link
Copy Markdown
Collaborator

@prk-Jr prk-Jr commented May 29, 2026

Summary

  • Deletes legacy_main, route_request, HandlerOutcome, and all canary flag-reading machinery (edgezero_enabled / edgezero_rollout_pct) now that EdgeZero has reached full functional parity and the cutover canary (PR19) is merged.
  • Removes the error module, the legacy route_tests file, and unused compat functions that only existed to support the old code path.
  • Simplifies main to a direct trampoline into edgezero_main, removing ~710 lines of dead code and the two config-store keys from fastly.toml.

Changes

File Change
crates/trusted-server-adapter-fastly/src/main.rs Delete legacy_main, route_request, HandlerOutcome, flag constants, and all associated imports (~710 lines removed)
crates/trusted-server-adapter-fastly/src/error.rs Delete entire module (only used by legacy path)
crates/trusted-server-adapter-fastly/src/route_tests.rs Delete legacy route test file
crates/trusted-server-adapter-fastly/src/compat.rs Remove legacy-only compat functions; keep Fastly↔EdgeZero conversion helpers
crates/trusted-server-adapter-fastly/src/platform.rs Remove build_runtime_services (legacy-only)
crates/trusted-server-adapter-fastly/src/app.rs Remove runtime_services_for_consent_route and build_state (legacy-only); update imports
crates/trusted-server-adapter-fastly/src/middleware.rs Clean up unused imports left behind by legacy removal
fastly.toml Remove edgezero_enabled and edgezero_rollout_pct config-store entries
docs/superpowers/plans/2026-05-27-pr20-legacy-cleanup.md Add plan document for this cleanup

Closes

Closes #501

Test plan

  • cargo fmt --all -- --check
  • cargo clippy-fastly
  • cargo clippy-axum
  • cargo test-fastly — 48 tests passed, 0 failed
  • cargo test-axum — 20 tests passed, 0 failed
  • JS tests: cd crates/js/lib && npx vitest run — 291 tests passed
  • JS format: cd crates/js/lib && npm run format
  • Docs format: cd docs && npm run format

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses log macros (not println!)
  • No secrets or credentials committed

prk-Jr added 13 commits May 27, 2026 19:27
route_tests.rs tested route_request() and HandlerOutcome, which are
legacy-path only. Equivalent EdgeZero dispatch coverage exists in
app.rs. Part of #501 legacy entry point cleanup.
Remove legacy_main(), route_request(), HandlerOutcome, and all flag-reading
machinery (edgezero_enabled / edgezero_rollout_pct). Entry point is now
a direct trampoline to edgezero_main(), which opens the config store
internally. Part of #501 legacy entry point cleanup.
Remove from_fastly_request(), to_fastly_response_skeleton(), and their
build_http_request() helper from compat.rs — all were only called from
legacy_main(). Delete error.rs entirely (to_error_response() was its only
export; only caller was legacy_main()). Part of #501.
Remove 14 canary-routing test functions and the JA4 debug test (if not
already removed). Strip all imports that were only consumed by deleted
code. Part of #501.
build_runtime_services() was the legacy-path per-request service factory.
The EdgeZero path uses build_per_request_services() in app.rs instead.
Remove the dead function, its noop_kv_store() test helper, and its tests.
Part of #501.
middleware.rs referenced deleted finalize_response() and route_request().
app.rs referenced deleted http_error_response() and route_request().
platform.rs had an orphaned section header after build_runtime_services
was removed. Part of #501.
Update middleware.rs module doc from 'dual-path' to 'EdgeZero entry
point'. Update two prose mentions of route_request in app.rs to
describe current EdgeZero behavior. Part of #501.
The app no longer reads these config store keys. Remove them from the
local dev config store. The trusted_server_config store itself stays —
it is still opened by open_trusted_server_config_store(). Part of #501.
Add backticks around EdgeZero in doc comments to satisfy doc_markdown
lint. Remove unused Arc import from platform.rs test module leftover
from build_runtime_services deletion. Part of #501.
@prk-Jr prk-Jr self-assigned this May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant