refactor(pipelock): split sidecar lifecycle into DockerPipelockProxy
test / run tests/run_tests.py (pull_request) Successful in 18s

PipelockProxy becomes an ABC with the platform-agnostic
prepare/_build_pipelock_yaml as concrete methods and start/stop as
abstract. Docker-specific sidecar lifecycle moves to a new sibling
file:

  claude_bottle/backend/docker/pipelock.py
    DockerPipelockProxy(PipelockProxy) — implements start (docker
    create/cp/network connect/start) and stop (docker inspect/rm -f).

DockerBottleBackend._proxy is now a DockerPipelockProxy instance.
Tests that previously instantiated PipelockProxy() directly switch to
DockerPipelockProxy() (the base is no longer constructable).
This commit is contained in:
2026-05-11 13:53:45 -04:00
parent 25e67137f2
commit edd8b444a6
6 changed files with 118 additions and 83 deletions
+3 -2
View File
@@ -13,7 +13,8 @@ from claude_bottle.backend.docker.network import (
network_create_internal,
network_remove,
)
from claude_bottle.pipelock import PipelockProxy, pipelock_container_name
from claude_bottle.backend.docker.pipelock import DockerPipelockProxy
from claude_bottle.pipelock import pipelock_container_name
from tests._docker import skip_unless_docker
@@ -69,7 +70,7 @@ class TestOrphanCleanup(unittest.TestCase):
def test_pipelock_stop_missing_sidecar(self):
# Should not raise.
PipelockProxy().stop(pipelock_container_name(f"missing-{self.slug}"))
DockerPipelockProxy().stop(pipelock_container_name(f"missing-{self.slug}"))
if __name__ == "__main__":