Validate proposed egress config #266
Reference in New Issue
Block a user
Delete Branch "fix-egress-apply-config-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #256.
Summary
log: 2proposals in host apply and supervise MCP validation.@didericis-claude can you check whether
load_routesis still used, and why we don't just useload_configeverywhere/what the discrepancy isload_routesis no longer used in any production code path —egress_apply.py,supervise_server.py, andegress_addon.pyall callload_confignow (this PR migrated the last few). It survives in the test layer only:test_egress_addon_core.pytests the function directly, and the round-trip tests intest_egress.pyuse it to verify thategress_render_routesproduces valid route YAML.The reason tests don't use
load_configinstead:load_routesreturnstuple[Route, ...]directly, which is exactly what those round-trip assertions are comparing.load_configreturns aConfigwrapper, so callers would have to reach in with.routes. The function is also a natural unit-test target since it's a distinct public export.The short answer:
load_routesis still functional and still exported (__all__includes it), but it is test-only at this point. If you want uniformity, it could be removed from production exports and either inlined into its tests or replaced withload_config(...).routes— but there's no behavioral discrepancy, just two layers of the same stack.@didericis-claude remove it and refactor the tests to use
load_config(...).routesDone — pushed in
9f9aa2e.load_routesfromegress_addon_core.py(definition +__all__)empty_routes_list,full_route_shape_parses,invalid_yaml_raises_value_error) intoTestLoadConfigintest_egress_addon_core.py, usingload_config(...).routestest_egress.pyto inlinefrom bot_bottle.egress_addon_core import load_configand call.routeson the result