Remove legacy entry point, canary routing, and flag plumbing#744
Open
prk-Jr wants to merge 13 commits into
Open
Remove legacy entry point, canary routing, and flag plumbing#744prk-Jr wants to merge 13 commits into
prk-Jr wants to merge 13 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.errormodule, the legacyroute_testsfile, and unused compat functions that only existed to support the old code path.mainto a direct trampoline intoedgezero_main, removing ~710 lines of dead code and the two config-store keys fromfastly.toml.Changes
crates/trusted-server-adapter-fastly/src/main.rslegacy_main,route_request,HandlerOutcome, flag constants, and all associated imports (~710 lines removed)crates/trusted-server-adapter-fastly/src/error.rscrates/trusted-server-adapter-fastly/src/route_tests.rscrates/trusted-server-adapter-fastly/src/compat.rscrates/trusted-server-adapter-fastly/src/platform.rsbuild_runtime_services(legacy-only)crates/trusted-server-adapter-fastly/src/app.rsruntime_services_for_consent_routeandbuild_state(legacy-only); update importscrates/trusted-server-adapter-fastly/src/middleware.rsfastly.tomledgezero_enabledandedgezero_rollout_pctconfig-store entriesdocs/superpowers/plans/2026-05-27-pr20-legacy-cleanup.mdCloses
Closes #501
Test plan
cargo fmt --all -- --checkcargo clippy-fastlycargo clippy-axumcargo test-fastly— 48 tests passed, 0 failedcargo test-axum— 20 tests passed, 0 failedcd crates/js/lib && npx vitest run— 291 tests passedcd crates/js/lib && npm run formatcd docs && npm run formatChecklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)