refactor: remove Tool Configs and Config Folders
These features are fully superseded by Config Profiles which provide: - Env vars, file mounts, port overrides, start commands, working dirs - Git mounts, profile composition, cycle detection - Default selection, project/tool-type scoping Changes: - Delete backend models: ToolConfig, ConfigFolder - Delete backend APIs: tool_configs.py, config_folders.py - Delete frontend API clients: tool_configs.ts, config_folders.ts - Remove Tool Config fetching from start_instance, use ConfigProfile only - Simplify merge_with_config to accept only profile (no tool_configs) - Remove configs/folders tabs from Tool Workshop page - Delete associated integration and unit tests - Add Alembic migration to drop tool_configs and config_folders tables Quality gates: backend tests 59 passed, frontend typecheck clean
This commit is contained in:
@@ -292,24 +292,41 @@ class TestComputeImageTag:
|
||||
|
||||
|
||||
class TestMergeWithConfig:
|
||||
"""Tests for merge_with_config."""
|
||||
"""Tests for merge_with_config (ConfigProfile only)."""
|
||||
|
||||
def test_applies_tool_config_env(self) -> None:
|
||||
def test_no_profile_returns_manifest_unchanged(self) -> None:
|
||||
manifest = {"name": "test"}
|
||||
configs = [
|
||||
{"config_type": "env", "key": "FOO", "value": "bar"},
|
||||
]
|
||||
result = merge_with_config(manifest, configs)
|
||||
result = merge_with_config(manifest)
|
||||
assert result["name"] == "test"
|
||||
assert result["_extra_env"] == {}
|
||||
assert result["_extra_volumes"] == []
|
||||
|
||||
def test_profile_env_vars(self) -> None:
|
||||
manifest = {"name": "test"}
|
||||
profile = {"environment_variables": {"FOO": "bar"}}
|
||||
result = merge_with_config(manifest, profile)
|
||||
assert result["_extra_env"]["FOO"] == "bar"
|
||||
|
||||
def test_applies_port_override(self) -> None:
|
||||
def test_profile_mounts(self) -> None:
|
||||
manifest = {"name": "test"}
|
||||
profile = {"mounts": [{"source": "/host", "target": "/container"}]}
|
||||
result = merge_with_config(manifest, profile)
|
||||
assert len(result["_extra_volumes"]) == 1
|
||||
|
||||
def test_profile_port_override(self) -> None:
|
||||
manifest = {"name": "test", "default_port": 8080}
|
||||
configs = [{"port_override": 3000}]
|
||||
result = merge_with_config(manifest, configs)
|
||||
profile = {"hints": {"port_override": 3000}}
|
||||
result = merge_with_config(manifest, profile)
|
||||
assert result["default_port"] == 3000
|
||||
|
||||
def test_applies_start_command(self) -> None:
|
||||
def test_profile_start_command(self) -> None:
|
||||
manifest = {"name": "test", "runtime": {"command": ["/bin/bash"]}}
|
||||
configs = [{"start_command": "/bin/sh"}]
|
||||
result = merge_with_config(manifest, configs)
|
||||
profile = {"hints": {"start_command": "/bin/sh"}}
|
||||
result = merge_with_config(manifest, profile)
|
||||
assert result["runtime"]["command"] == ["/bin/sh"]
|
||||
|
||||
def test_profile_working_directory(self) -> None:
|
||||
manifest = {"name": "test"}
|
||||
profile = {"hints": {"working_directory": "/workspace"}}
|
||||
result = merge_with_config(manifest, profile)
|
||||
assert result["runtime"]["working_dir"] == "/workspace"
|
||||
|
||||
Reference in New Issue
Block a user