refactor(docker): inline pipelock_write_yaml body into prepare_proxy
test / run tests/run_tests.py (pull_request) Successful in 16s

The yaml generation logic moves wholesale onto DockerBottleBackend
where it's used. pipelock_write_yaml is deleted; pipelock.py keeps
the allowlist resolution helpers (still called by prepare_proxy and
by pipelock_allowlist_summary).

The pipelock_start error message that referenced "pipelock_write_yaml
must run first" now says "backend.prepare_proxy must run first."

tests/test_pipelock_yaml.py rewritten to drive DockerBottleBackend().
prepare_proxy(spec, yaml_path); test_pipelock_sidecar_smoke.py call
site updated similarly. Same coverage at the new location.
This commit is contained in:
2026-05-11 01:04:47 -04:00
parent 8457869dcd
commit 11f17d7927
4 changed files with 81 additions and 60 deletions
+11 -2
View File
@@ -12,7 +12,9 @@ import unittest
import urllib.request
from pathlib import Path
from claude_bottle.pipelock import PIPELOCK_IMAGE, pipelock_write_yaml
from claude_bottle.backend import BottleSpec
from claude_bottle.backend.docker import DockerBottleBackend
from claude_bottle.pipelock import PIPELOCK_IMAGE
from tests._docker import skip_unless_docker
from tests.fixtures import fixture_minimal
@@ -38,7 +40,14 @@ class TestPipelockSidecarSmoke(unittest.TestCase):
)
def test_smoke(self):
yaml_path = self.work_dir / "pipelock.yaml"
pipelock_write_yaml(fixture_minimal(), "dev", yaml_path)
spec = BottleSpec(
manifest=fixture_minimal(),
agent_name="demo",
copy_cwd=False,
user_cwd="/tmp",
forward_oauth_token=False,
)
DockerBottleBackend().prepare_proxy(spec, yaml_path)
create = subprocess.run(
[