fix(firecracker): repair runtime Git config ownership
tracker-policy-pr / check-pr (pull_request) Successful in 9s
test / integration-docker (pull_request) Successful in 17s
test / unit (pull_request) Successful in 41s
lint / lint (push) Successful in 52s
test / integration-firecracker (pull_request) Failing after 5m32s
test / coverage (pull_request) Has been skipped
test / publish-infra (pull_request) Has been skipped

This commit is contained in:
2026-07-21 18:09:27 +00:00
parent 735d8ed5f3
commit 7512e3179a
2 changed files with 29 additions and 0 deletions
+15
View File
@@ -259,6 +259,21 @@ class AgentProvider(ABC):
BottleBackend.provision_workspace against the running bottle."""
from .log import info
# Firecracker exports image rootfs files through an unprivileged host
# tar extraction, so image-time ownership of XDG directories is not
# preserved. Git consults ~/.config/git even when the actual config
# is ~/.gitconfig; an unreadable directory there can prevent the
# git-gate insteadOf rules below from taking effect. Repair this at
# runtime, after every backend's copy/export path has completed.
git_xdg_dir = f"{plan.guest_home}/.config/git"
bottle.exec(
f"mkdir -p {shlex.quote(git_xdg_dir)} && "
f"chown -R node:node {shlex.quote(f'{plan.guest_home}/.config')} && "
f"chmod 755 {shlex.quote(f'{plan.guest_home}/.config')} "
f"{shlex.quote(git_xdg_dir)}",
user="root",
)
manifest_bottle = plan.manifest.bottle
if manifest_bottle.git:
from .git_gate import GIT_GATE_HOSTNAME, git_gate_render_gitconfig