mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-05 23:36:37 +00:00
Restore public release proof entrypoints
This commit is contained in:
parent
81bcaa076b
commit
219826eeef
16 changed files with 197 additions and 11 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
@ -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())
|
||||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
21
scripts/release_control/mobile_relay_auth_approvals_proof.py
Normal file
21
scripts/release_control/mobile_relay_auth_approvals_proof.py
Normal 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())
|
||||
31
scripts/release_control/proof_entrypoints_test.py
Normal file
31
scripts/release_control/proof_entrypoints_test.py
Normal 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)
|
||||
|
|
@ -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())
|
||||
Loading…
Add table
Add a link
Reference in a new issue