From 219826eeef7e72e92a39ae11d72dec96f246a4a1 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 28 Mar 2026 17:35:17 +0000 Subject: [PATCH] Restore public release proof entrypoints --- .gitignore | 5 +++ ...mercial_cancellation_reactivation_proof.py | 21 +++++++++++++ ...ial_cancellation_reactivation_rehearsal.py | 21 +++++++++++++ ...mercial_cancellation_reactivation_proof.py | 2 +- ...al_cancellation_reactivation_proof_test.py | 13 ++++++++ ...ial_cancellation_reactivation_rehearsal.py | 2 +- ...ancellation_reactivation_rehearsal_test.py | 13 ++++++++ .../mobile_relay_auth_approvals_proof.py | 2 +- .../mobile_relay_auth_approvals_proof_test.py | 26 ++++++++++++++-- ...elay_registration_reconnect_drain_proof.py | 2 +- ...registration_reconnect_drain_proof_test.py | 20 ++++++++++-- .../internal/verify_commit_slice.py | 2 +- .../internal/verify_commit_slice_test.py | 6 ++++ .../mobile_relay_auth_approvals_proof.py | 21 +++++++++++++ .../release_control/proof_entrypoints_test.py | 31 +++++++++++++++++++ ...elay_registration_reconnect_drain_proof.py | 21 +++++++++++++ 16 files changed, 197 insertions(+), 11 deletions(-) create mode 100644 scripts/release_control/commercial_cancellation_reactivation_proof.py create mode 100644 scripts/release_control/commercial_cancellation_reactivation_rehearsal.py create mode 100644 scripts/release_control/mobile_relay_auth_approvals_proof.py create mode 100644 scripts/release_control/proof_entrypoints_test.py create mode 100644 scripts/release_control/relay_registration_reconnect_drain_proof.py diff --git a/.gitignore b/.gitignore index e415f2ecc..4dd53580e 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/scripts/release_control/commercial_cancellation_reactivation_proof.py b/scripts/release_control/commercial_cancellation_reactivation_proof.py new file mode 100644 index 000000000..0fb438f24 --- /dev/null +++ b/scripts/release_control/commercial_cancellation_reactivation_proof.py @@ -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()) diff --git a/scripts/release_control/commercial_cancellation_reactivation_rehearsal.py b/scripts/release_control/commercial_cancellation_reactivation_rehearsal.py new file mode 100644 index 000000000..d198146e7 --- /dev/null +++ b/scripts/release_control/commercial_cancellation_reactivation_rehearsal.py @@ -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()) diff --git a/scripts/release_control/internal/commercial_cancellation_reactivation_proof.py b/scripts/release_control/internal/commercial_cancellation_reactivation_proof.py index 75db0ec30..2defb7d06 100644 --- a/scripts/release_control/internal/commercial_cancellation_reactivation_proof.py +++ b/scripts/release_control/internal/commercial_cancellation_reactivation_proof.py @@ -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: diff --git a/scripts/release_control/internal/commercial_cancellation_reactivation_proof_test.py b/scripts/release_control/internal/commercial_cancellation_reactivation_proof_test.py index 0328efea8..074dfd7fc 100644 --- a/scripts/release_control/internal/commercial_cancellation_reactivation_proof_test.py +++ b/scripts/release_control/internal/commercial_cancellation_reactivation_proof_test.py @@ -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" diff --git a/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal.py b/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal.py index e6983558b..1346bc17a 100644 --- a/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal.py +++ b/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal.py @@ -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: diff --git a/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal_test.py b/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal_test.py index 41cc034cc..7c379936a 100644 --- a/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal_test.py +++ b/scripts/release_control/internal/commercial_cancellation_reactivation_rehearsal_test.py @@ -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) diff --git a/scripts/release_control/internal/mobile_relay_auth_approvals_proof.py b/scripts/release_control/internal/mobile_relay_auth_approvals_proof.py index 1c7ca9d48..af55e772b 100644 --- a/scripts/release_control/internal/mobile_relay_auth_approvals_proof.py +++ b/scripts/release_control/internal/mobile_relay_auth_approvals_proof.py @@ -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: diff --git a/scripts/release_control/internal/mobile_relay_auth_approvals_proof_test.py b/scripts/release_control/internal/mobile_relay_auth_approvals_proof_test.py index 011cc039a..62c167051 100644 --- a/scripts/release_control/internal/mobile_relay_auth_approvals_proof_test.py +++ b/scripts/release_control/internal/mobile_relay_auth_approvals_proof_test.py @@ -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__": diff --git a/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py b/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py index fdcb338f8..cee627c41 100644 --- a/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py +++ b/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py @@ -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: diff --git a/scripts/release_control/internal/relay_registration_reconnect_drain_proof_test.py b/scripts/release_control/internal/relay_registration_reconnect_drain_proof_test.py index 41e9aeacc..26806b52a 100644 --- a/scripts/release_control/internal/relay_registration_reconnect_drain_proof_test.py +++ b/scripts/release_control/internal/relay_registration_reconnect_drain_proof_test.py @@ -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__": diff --git a/scripts/release_control/internal/verify_commit_slice.py b/scripts/release_control/internal/verify_commit_slice.py index 67be06dea..86a4fcf88 100644 --- a/scripts/release_control/internal/verify_commit_slice.py +++ b/scripts/release_control/internal/verify_commit_slice.py @@ -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" diff --git a/scripts/release_control/internal/verify_commit_slice_test.py b/scripts/release_control/internal/verify_commit_slice_test.py index c8ef9d2e5..547d1a42b 100644 --- a/scripts/release_control/internal/verify_commit_slice_test.py +++ b/scripts/release_control/internal/verify_commit_slice_test.py @@ -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 diff --git a/scripts/release_control/mobile_relay_auth_approvals_proof.py b/scripts/release_control/mobile_relay_auth_approvals_proof.py new file mode 100644 index 000000000..fe93e0f00 --- /dev/null +++ b/scripts/release_control/mobile_relay_auth_approvals_proof.py @@ -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()) diff --git a/scripts/release_control/proof_entrypoints_test.py b/scripts/release_control/proof_entrypoints_test.py new file mode 100644 index 000000000..77c1a730a --- /dev/null +++ b/scripts/release_control/proof_entrypoints_test.py @@ -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) diff --git a/scripts/release_control/relay_registration_reconnect_drain_proof.py b/scripts/release_control/relay_registration_reconnect_drain_proof.py new file mode 100644 index 000000000..432cd0ba4 --- /dev/null +++ b/scripts/release_control/relay_registration_reconnect_drain_proof.py @@ -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())