refactor: unify identity/provisioned_key into key block
Replace the two mutually-exclusive repo keys (identity and provisioned_key) with a single required key block. key.provider is "static" (path to host SSH key) or "gitea" (deploy-key lifecycle via provisioner_token env var, replacing token_env). Internal fields: ManifestProvisionedKeyConfig → ManifestKeyConfig; ProvisionedKey field removed from ManifestGitEntry; Key field added. git_gate.py checks entry.Key.provider == "gitea" instead of entry.ProvisionedKey is not None.
This commit is contained in:
@@ -116,8 +116,8 @@ class TestExtendsGitMerge(unittest.TestCase):
|
||||
"""git-gate.user overlays by field; git-gate.repos merges by upstream
|
||||
host, with child entries replacing duplicate hosts."""
|
||||
|
||||
_GIT_ENTRY_A = {"url": "ssh://git@host-a/a.git", "identity": "/dev/null"}
|
||||
_GIT_ENTRY_B = {"url": "ssh://git@host-b/b.git", "identity": "/dev/null"}
|
||||
_GIT_ENTRY_A = {"url": "ssh://git@host-a/a.git", "key": {"provider": "static", "path": "/dev/null"}}
|
||||
_GIT_ENTRY_B = {"url": "ssh://git@host-b/b.git", "key": {"provider": "static", "path": "/dev/null"}}
|
||||
|
||||
def test_child_git_repos_merge_with_parent(self):
|
||||
m = _build(
|
||||
@@ -131,7 +131,7 @@ class TestExtendsGitMerge(unittest.TestCase):
|
||||
self.assertEqual(["a", "b"], names)
|
||||
|
||||
def test_child_git_repo_replaces_same_host(self):
|
||||
replacement = {"url": "ssh://git@host-a/replacement.git", "identity": "/dev/null"}
|
||||
replacement = {"url": "ssh://git@host-a/replacement.git", "key": {"provider": "static", "path": "/dev/null"}}
|
||||
m = _build(
|
||||
base={"git-gate": {"repos": {"a": self._GIT_ENTRY_A}}},
|
||||
child={
|
||||
|
||||
Reference in New Issue
Block a user