fix(git-gate): skip host key-file check for gitea-provider repos
_validate_git_entries was written for static keys (PRD 0008) and ran
os.path.isfile() on every entry's IdentityFile. gitea-provider repos
(PRD 0047/0048) create their deploy key at provision time, so
IdentityFile is empty at parse — tripping the check with an empty path
("git upstream key file not found for '<name>': "). Gate the host-file
check on the static provider; gitea entries have nothing to verify here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -381,11 +381,17 @@ class BottleBackend(ABC, Generic[PlanT, CleanupT]):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _validate_git_entries(self, entries: Sequence[ManifestGitEntry]) -> None:
|
def _validate_git_entries(self, entries: Sequence[ManifestGitEntry]) -> None:
|
||||||
"""Each entry's IdentityFile must exist on the host (after
|
"""Each `static`-provider entry's IdentityFile must exist on the
|
||||||
expanding leading ~) — the git-gate copies it in at start time
|
host (after expanding leading ~) — the git-gate copies it in at
|
||||||
to authenticate the upstream push (PRD 0008). Shape is already
|
start time to authenticate the upstream push (PRD 0008). Shape is
|
||||||
enforced by Manifest validation; this only checks presence."""
|
already enforced by Manifest validation; this only checks presence.
|
||||||
|
|
||||||
|
`gitea`-provider entries (PRD 0047/0048) carry no host key:
|
||||||
|
IdentityFile is empty at parse time and the deploy key is created
|
||||||
|
at provision time, so there is nothing to check here."""
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
|
if entry.Key.provider != "static":
|
||||||
|
continue
|
||||||
key = expand_tilde(entry.IdentityFile)
|
key = expand_tilde(entry.IdentityFile)
|
||||||
if not os.path.isfile(key):
|
if not os.path.isfile(key):
|
||||||
die(f"git upstream key file not found for '{entry.Name}': {key}")
|
die(f"git upstream key file not found for '{entry.Name}': {key}")
|
||||||
|
|||||||
Reference in New Issue
Block a user