refactor(manifest): key git config by host
test / unit (pull_request) Successful in 33s
test / integration (pull_request) Successful in 42s

This commit is contained in:
2026-05-28 00:49:34 -04:00
parent 85104742ca
commit 59ee32cc8d
17 changed files with 356 additions and 159 deletions
+13 -4
View File
@@ -31,6 +31,12 @@ from claude_bottle.pipelock import PipelockProxyPlan
from claude_bottle.supervise import SupervisePlan
def _remote_host(g: GitEntry) -> str:
if g.UpstreamHost:
return g.UpstreamHost
return g.Upstream.split("@", 1)[1].split("/", 1)[0].split(":", 1)[0]
def _plan(
*,
agent_prompt: str = "",
@@ -49,17 +55,20 @@ def _plan(
agent_supervise_url: str = "http://127.0.0.1:55556/",
) -> SmolmachinesBottlePlan:
bottle_json: dict = {}
git_json: dict = {}
if git:
bottle_json["git"] = [
{
git_json["remotes"] = {
_remote_host(g): {
"Name": g.Name,
"Upstream": g.Upstream,
"IdentityFile": g.IdentityFile,
}
for g in git
]
}
if git_user is not None:
bottle_json["git_user"] = git_user
git_json["user"] = git_user
if git_json:
bottle_json["git"] = git_json
if supervise:
bottle_json["supervise"] = True
manifest = Manifest.from_json_obj({