Restore public release proof entrypoints

This commit is contained in:
rcourtman 2026-03-28 17:35:17 +00:00
parent 81bcaa076b
commit 219826eeef
16 changed files with 197 additions and 11 deletions

5
.gitignore vendored
View file

@ -222,6 +222,8 @@ scripts/release_control/
scripts/release_control/*
!scripts/release_control/canonical_completion_guard.py
!scripts/release_control/canonical_completion_guard_test.py
!scripts/release_control/commercial_cancellation_reactivation_proof.py
!scripts/release_control/commercial_cancellation_reactivation_rehearsal.py
!scripts/release_control/contract_audit.py
!scripts/release_control/contract_audit_test.py
!scripts/release_control/control_plane.py
@ -232,9 +234,12 @@ scripts/release_control/*
!scripts/release_control/format_staged_go_test.py
!scripts/release_control/governance_stage_guard.py
!scripts/release_control/governance_stage_guard_test.py
!scripts/release_control/mobile_relay_auth_approvals_proof.py
!scripts/release_control/proof_entrypoints_test.py
!scripts/release_control/readiness_assertion_guard.py
!scripts/release_control/readiness_assertion_guard_test.py
!scripts/release_control/record_rc_to_ga_blocked.py
!scripts/release_control/relay_registration_reconnect_drain_proof.py
!scripts/release_control/registry_audit.py
!scripts/release_control/registry_audit_test.py
!scripts/release_control/release_promotion_policy_support.py

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
import runpy
def main(argv: list[str] | None = None) -> int:
namespace = runpy.run_path(
str(
Path(__file__).resolve().parent
/ "internal"
/ "commercial_cancellation_reactivation_proof.py"
)
)
return namespace["main"](argv)
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
import runpy
def main(argv: list[str] | None = None) -> int:
namespace = runpy.run_path(
str(
Path(__file__).resolve().parent
/ "internal"
/ "commercial_cancellation_reactivation_rehearsal.py"
)
)
return namespace["main"](argv)
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -66,7 +66,7 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
def default_pulse_dir() -> Path:
return Path(__file__).resolve().parents[2]
return Path(__file__).resolve().parents[3]
def default_pulse_pro_license_server_dir() -> Path:

View file

@ -3,10 +3,16 @@ from __future__ import annotations
import contextlib
import io
import json
import sys
import tempfile
import unittest
from pathlib import Path
INTERNAL_DIR = Path(__file__).resolve().parent
if str(INTERNAL_DIR) not in sys.path:
sys.path.insert(0, str(INTERNAL_DIR))
import commercial_cancellation_reactivation_proof as proof
@ -18,6 +24,13 @@ def run_main(argv: list[str]) -> tuple[int, str]:
class CommercialCancellationReactivationProofTest(unittest.TestCase):
def test_default_paths_resolve_from_internal_script_location(self) -> None:
self.assertEqual(proof.default_pulse_dir(), Path(proof.__file__).resolve().parents[3])
self.assertEqual(
proof.default_pulse_pro_license_server_dir(),
proof.default_pulse_dir().parent / "pulse-pro" / "license-server",
)
def test_build_command_specs_uses_expected_directories(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
pulse_dir = Path(tmp) / "pulse"

View file

@ -21,7 +21,7 @@ class CommandResult:
def default_pulse_dir() -> Path:
return Path(__file__).resolve().parents[2]
return Path(__file__).resolve().parents[3]
def default_integration_dir() -> Path:

View file

@ -3,15 +3,28 @@
from __future__ import annotations
import sys
import tempfile
import unittest
from pathlib import Path
from unittest import mock
INTERNAL_DIR = Path(__file__).resolve().parent
if str(INTERNAL_DIR) not in sys.path:
sys.path.insert(0, str(INTERNAL_DIR))
import commercial_cancellation_reactivation_rehearsal as rehearsal
class BuildCommandTests(unittest.TestCase):
def test_default_paths_resolve_from_internal_script_location(self) -> None:
self.assertEqual(rehearsal.default_pulse_dir(), Path(rehearsal.__file__).resolve().parents[3])
self.assertEqual(
rehearsal.default_integration_dir(),
rehearsal.default_pulse_dir() / "tests" / "integration",
)
def test_run_rehearsal_uses_expected_commands(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)

View file

@ -28,7 +28,7 @@ class CommandResult:
def default_pulse_dir() -> Path:
return Path(__file__).resolve().parents[2]
return Path(__file__).resolve().parents[3]
def default_pulse_mobile_dir() -> Path:

View file

@ -3,19 +3,39 @@
from __future__ import annotations
import sys
import unittest
from pathlib import Path
INTERNAL_DIR = Path(__file__).resolve().parent
if str(INTERNAL_DIR) not in sys.path:
sys.path.insert(0, str(INTERNAL_DIR))
import mobile_relay_auth_approvals_proof as proof
class MobileRelayAuthApprovalsProofTest(unittest.TestCase):
def test_default_paths_resolve_from_internal_script_location(self) -> None:
self.assertEqual(proof.default_pulse_dir(), Path(proof.__file__).resolve().parents[3])
self.assertEqual(
proof.default_pulse_mobile_dir(),
proof.default_pulse_dir().parent / "pulse-mobile",
)
self.assertEqual(
proof.default_pulse_enterprise_dir(),
proof.default_pulse_dir().parent / "pulse-enterprise",
)
def test_build_command_specs_are_sorted_and_cross_repo(self) -> None:
args = proof.parse_args([])
specs = proof.build_command_specs(args)
self.assertEqual([spec.name for spec in specs], sorted(spec.name for spec in specs))
self.assertTrue(all(spec.cwd.endswith(("pulse-mobile", "pulse-enterprise")) for spec in specs))
self.assertTrue(any(spec.cwd.endswith("pulse-enterprise") for spec in specs))
self.assertTrue(any(spec.cwd.endswith("pulse-mobile") for spec in specs))
self.assertTrue(
all(Path(spec.cwd) in {proof.default_pulse_mobile_dir(), proof.default_pulse_enterprise_dir()} for spec in specs)
)
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_enterprise_dir() for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_mobile_dir() for spec in specs))
if __name__ == "__main__":

View file

@ -28,7 +28,7 @@ class CommandResult:
def default_pulse_dir() -> Path:
return Path(__file__).resolve().parents[2]
return Path(__file__).resolve().parents[3]
def default_pulse_mobile_dir() -> Path:

View file

@ -3,20 +3,34 @@
from __future__ import annotations
import sys
import unittest
from pathlib import Path
INTERNAL_DIR = Path(__file__).resolve().parent
if str(INTERNAL_DIR) not in sys.path:
sys.path.insert(0, str(INTERNAL_DIR))
import relay_registration_reconnect_drain_proof as proof
class RelayRegistrationReconnectDrainProofTest(unittest.TestCase):
def test_default_paths_resolve_from_internal_script_location(self) -> None:
self.assertEqual(proof.default_pulse_dir(), Path(proof.__file__).resolve().parents[3])
self.assertEqual(
proof.default_pulse_mobile_dir(),
proof.default_pulse_dir().parent / "pulse-mobile",
)
def test_build_command_specs_are_sorted_and_cover_expected_workspaces(self) -> None:
args = proof.parse_args([])
specs = proof.build_command_specs(args)
self.assertEqual([spec.name for spec in specs], sorted(spec.name for spec in specs))
self.assertIn("relay-managed-runtime", [spec.name for spec in specs])
self.assertTrue(any(spec.cwd.endswith("frontend-modern") for spec in specs))
self.assertTrue(any(spec.cwd.endswith("pulse-mobile") for spec in specs))
self.assertTrue(any(spec.cwd.endswith("pulse") for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_dir() / "frontend-modern" for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_mobile_dir() for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_dir() for spec in specs))
if __name__ == "__main__":

View file

@ -12,7 +12,7 @@ import tempfile
from typing import Iterable
REPO_ROOT = Path(__file__).resolve().parents[2]
REPO_ROOT = Path(__file__).resolve().parents[3]
HOOK_PATH = REPO_ROOT / ".husky" / "pre-commit"

View file

@ -1,10 +1,16 @@
import os
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
INTERNAL_DIR = Path(__file__).resolve().parent
if str(INTERNAL_DIR) not in sys.path:
sys.path.insert(0, str(INTERNAL_DIR))
from verify_commit_slice import main, repo_relative_path

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
import runpy
def main(argv: list[str] | None = None) -> int:
namespace = runpy.run_path(
str(
Path(__file__).resolve().parent
/ "internal"
/ "mobile_relay_auth_approvals_proof.py"
)
)
return namespace["main"](argv)
if __name__ == "__main__":
raise SystemExit(main())

View file

@ -0,0 +1,31 @@
from __future__ import annotations
import subprocess
import unittest
from pathlib import Path
RELEASE_CONTROL_DIR = Path(__file__).resolve().parent
class ProofEntrypointsTest(unittest.TestCase):
def test_documented_release_control_entrypoints_exist_and_show_help(self) -> None:
entrypoints = [
"commercial_cancellation_reactivation_proof.py",
"commercial_cancellation_reactivation_rehearsal.py",
"mobile_relay_auth_approvals_proof.py",
"relay_registration_reconnect_drain_proof.py",
]
for entrypoint in entrypoints:
with self.subTest(entrypoint=entrypoint):
path = RELEASE_CONTROL_DIR / entrypoint
self.assertTrue(path.is_file())
result = subprocess.run(
["python3", str(path), "--help"],
cwd=RELEASE_CONTROL_DIR.parent.parent,
capture_output=True,
text=True,
check=False,
)
self.assertEqual(result.returncode, 0)
self.assertIn("usage:", result.stdout)

View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
from __future__ import annotations
from pathlib import Path
import runpy
def main(argv: list[str] | None = None) -> int:
namespace = runpy.run_path(
str(
Path(__file__).resolve().parent
/ "internal"
/ "relay_registration_reconnect_drain_proof.py"
)
)
return namespace["main"](argv)
if __name__ == "__main__":
raise SystemExit(main())