refactor: extract shared resolve_plan helpers into backend/resolve_common.py
lint / lint (push) Failing after 1m27s
test / unit (pull_request) Successful in 29s
test / integration (pull_request) Failing after 15s

Both docker and smolmachines resolve_plan.py duplicated: slug minting,
metadata writing, agent state dir setup, git gate / egress / supervise
preparation, env_vars merge, and manifest dockerfile path resolution.

These are now consolidated in bot_bottle/backend/resolve_common.py.
Each backend's resolve_plan retains only its own logic (container name
resolution + env-file for docker; subnet allocation + guest_env build
for smolmachines).
This commit is contained in:
2026-06-08 14:46:04 +00:00
parent 4359bd6099
commit c39d5dc63f
4 changed files with 177 additions and 162 deletions
+3 -3
View File
@@ -55,9 +55,9 @@ class TestSmolmachinesResolveEnv(unittest.TestCase):
patch("bot_bottle.backend.smolmachines.resolve_plan.smolmachines_preflight"),
patch("bot_bottle.backend.smolmachines.resolve_plan.smolmachines_bundle_subnet",
return_value=("10.99.0.0/24", "10.99.0.1", "10.99.0.2")),
patch("bot_bottle.backend.smolmachines.resolve_plan.GitGate") as mock_gg,
patch("bot_bottle.backend.smolmachines.resolve_plan.Egress") as mock_eg,
patch("bot_bottle.backend.smolmachines.resolve_plan.Supervise"),
patch("bot_bottle.backend.resolve_common.GitGate") as mock_gg,
patch("bot_bottle.backend.resolve_common.Egress") as mock_eg,
patch("bot_bottle.backend.resolve_common.Supervise"),
patch(
"bot_bottle.backend.smolmachines.resolve_plan.agent_provision_plan"
) as mock_app,