refactor: address PR review feedback — de-privatize helpers and rename modules
test / unit (pull_request) Successful in 33s
test / integration (pull_request) Successful in 43s

- Rename _manifest_util.py → manifest_util.py (module isn't private)
- Rename _as_json_object → as_json_object, _parse_git_upstream → parse_git_upstream,
  _parse_git_gate_config → parse_git_gate_config,
  _validate_unique_git_names → validate_unique_git_names,
  _validate_egress_routes → validate_egress_routes (none are private at
  module boundary — underscore prefix was a carry-over from the old
  monolithic manifest.py where everything lived in one namespace)
- Move _is_ip_literal → util.is_ip_literal (generic, belongs in the
  top-level util module)
- Update all import sites across manifest_*.py, manifest_extends.py,
  manifest_schema.py; existing callers of manifest.py are unaffected

All 867 unit tests pass.
This commit is contained in:
2026-06-03 04:32:25 +00:00
parent 9b81173699
commit 5ac6c8199c
8 changed files with 46 additions and 48 deletions
+4 -4
View File
@@ -72,7 +72,7 @@ def _merge_bottles(
) -> Bottle:
"""Apply PRD 0025 merge rules."""
from .manifest import Bottle, GitUser
from .manifest_egress import _validate_egress_routes
from .manifest_egress import validate_egress_routes
# Parse the child's declared fields into a Bottle (with the
# usual defaults for anything missing). Validation runs the same
@@ -110,7 +110,7 @@ def _merge_bottles(
merged_supervise = (
child.supervise if "supervise" in child_raw else parent.supervise
)
_validate_egress_routes(name, merged_egress.routes)
validate_egress_routes(name, merged_egress.routes)
return Bottle(
env=merged_env,
@@ -123,12 +123,12 @@ def _merge_bottles(
def _child_declares_git_gate_repos(child_raw: dict[str, object]) -> bool:
from ._manifest_util import _as_json_object
from .manifest_util import as_json_object
git_raw = child_raw.get("git-gate")
if git_raw is None:
return False
git_obj = _as_json_object(git_raw, "child git-gate")
git_obj = as_json_object(git_raw, "child git-gate")
return "repos" in git_obj