refactor: prefix all manifest data classes with Manifest
Avoids name collisions with same-named runtime/plugin classes (e.g. manifest AgentProvider vs plugin AgentProvider ABC, manifest EgressRoute vs runtime EgressRoute). Renamed: AgentProvider → ManifestAgentProvider (manifest_agent.py) Agent → ManifestAgent (manifest_agent.py) EgressRoute → ManifestEgressRoute (manifest_egress.py) PathMatch → ManifestPathMatch (manifest_egress.py) HeaderMatch → ManifestHeaderMatch (manifest_egress.py) MatchEntry → ManifestMatchEntry (manifest_egress.py) EgressConfig → ManifestEgressConfig (manifest_egress.py) Bottle → ManifestBottle (manifest.py) ProvisionedKeyConfig → ManifestProvisionedKeyConfig (manifest_git.py) GitEntry → ManifestGitEntry (manifest_git.py) GitUser → ManifestGitUser (manifest_git.py)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from bot_bottle.manifest import ManifestError, GitUser, Manifest
|
||||
from bot_bottle.manifest import ManifestError, ManifestGitUser, Manifest
|
||||
|
||||
|
||||
def _error_message(callable_, *args, **kwargs) -> str: # type: ignore
|
||||
@@ -99,13 +99,13 @@ class TestGitUserDirect(unittest.TestCase):
|
||||
"""Direct GitUser dataclass exercises (no manifest wrapper)."""
|
||||
|
||||
def test_is_empty_default(self):
|
||||
self.assertTrue(GitUser().is_empty())
|
||||
self.assertTrue(ManifestGitUser().is_empty())
|
||||
|
||||
def test_is_empty_false_when_name_set(self):
|
||||
self.assertFalse(GitUser(name="x").is_empty())
|
||||
self.assertFalse(ManifestGitUser(name="x").is_empty())
|
||||
|
||||
def test_is_empty_false_when_email_set(self):
|
||||
self.assertFalse(GitUser(email="x@y").is_empty())
|
||||
self.assertFalse(ManifestGitUser(email="x@y").is_empty())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -7,7 +7,7 @@ silently ignoring."""
|
||||
import unittest
|
||||
from typing import Any
|
||||
|
||||
from bot_bottle.manifest import ManifestError, Bottle, Manifest
|
||||
from bot_bottle.manifest import ManifestError, ManifestBottle, Manifest
|
||||
|
||||
|
||||
def _manifest_with_runtime(value: object) -> dict[str, Any]:
|
||||
@@ -26,7 +26,7 @@ class TestManifestRuntimeRemoved(unittest.TestCase):
|
||||
self.assertIn("dev", m.bottles)
|
||||
|
||||
def test_bottle_dataclass_has_no_runtime_attribute(self):
|
||||
self.assertFalse(hasattr(Bottle(), "runtime"))
|
||||
self.assertFalse(hasattr(ManifestBottle(), "runtime"))
|
||||
|
||||
def test_any_runtime_value_is_rejected(self):
|
||||
for value in ("runsc", "runc", "kata-runtime", "", 42, None):
|
||||
|
||||
@@ -33,7 +33,7 @@ from bot_bottle.backend.smolmachines.launch import _bundle_launch_spec
|
||||
from bot_bottle.backend.util import AGENT_CA_PATH
|
||||
from bot_bottle.egress import EgressPlan, EgressRoute
|
||||
from bot_bottle.git_gate import GitGatePlan, GitGateUpstream
|
||||
from bot_bottle.manifest import GitEntry, Manifest
|
||||
from bot_bottle.manifest import ManifestGitEntry, Manifest
|
||||
from bot_bottle.supervise import SupervisePlan
|
||||
from bot_bottle.workspace import workspace_plan
|
||||
|
||||
@@ -85,7 +85,7 @@ def _plan(
|
||||
*,
|
||||
agent_prompt: str = "",
|
||||
skills: list[str] | None = None,
|
||||
git: list[GitEntry] = (), # type: ignore
|
||||
git: list[ManifestGitEntry] = (), # type: ignore
|
||||
git_user: dict | None = None, # type: ignore
|
||||
copy_cwd: bool = False,
|
||||
user_cwd: str = "/tmp/x",
|
||||
@@ -392,7 +392,7 @@ class TestProvisionGit(unittest.TestCase):
|
||||
# git HTTP port is published on host loopback at launch
|
||||
# time, and the plan carries the discovered host port.
|
||||
plan = _plan(
|
||||
git=[GitEntry(
|
||||
git=[ManifestGitEntry(
|
||||
Name="bot-bottle",
|
||||
Upstream="ssh://git@host/repo.git",
|
||||
IdentityFile="~/.ssh/id_ed25519",
|
||||
|
||||
Reference in New Issue
Block a user