Split git_gate.py into render / provision / control modules #309
Reference in New Issue
Block a user
Delete Branch "decompose-git-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #303.
Summary
git_gate.py(699 LOC) mixed three responsibilities. Split into focused modules, re-exporting fromgit_gateso all 19 importers are unchanged (same pattern as #291):git_gate_render.py— pure host-side rendering: theGIT_GATE_*constants,GitGateUpstream, gitconfig / known-hosts rendering, and the entrypoint / pre-receive / access-hook script builders.git_gate_provision.py— the gitea deploy-key lifecycle (_provision_dynamic_key/revoke_git_gate_provisioned_keys/_resolve_identity_file).git_gate.py— theGitGateABC +GitGatePlan, now 169 LOC, re-exporting all moved names via__all__.Notes
Dockerfile.sidecars), so no flat-import shim needed._provision_dynamic_keylookup (bot_bottle.git_gate.…); repointed tobot_bottle.git_gate_provision.…where_resolve_identity_filenow resolves it. Public API unchanged.git_gate_render.py+git_gate_provision.pytoscripts/critical-modules.txt— the decompose moves security code (gitconfig-injection validation, deploy-key lifecycle) out of the measuredgit_gate.py, so the single-source-of-truth list must follow it or the core metric silently shrinks. Critical aggregate stays 95% (git_gate 100%, render 100%, provision 97%).Full suite (1476) passes; pyright clean; pylint 9.87.