Coverage for scripts / example_job_validation / registry.py: 100.00%

7 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-09-14 22:07 +0000

1"""The example-validation action registry. 

2 

3Reuses the live-release-validation actions verbatim for everything except 

4the two new ones: ``static`` (offline example checks, no AWS) and 

5``examples`` (the live per-example lifecycle). Structure tests hold this 

6registry in lockstep with ``docs/EXAMPLE_VALIDATION.md``. 

7""" 

8 

9from __future__ import annotations 

10 

11from scripts.live_release_validation.actions import ( 

12 action_baseline, 

13 action_deploy, 

14 action_destroy, 

15 action_final_inventory, 

16 action_preflight, 

17) 

18from scripts.live_release_validation.registry import ActionDefinition 

19 

20from .actions import action_examples, action_static 

21 

22 

23def build_action_registry() -> dict[str, ActionDefinition]: 

24 """Return actions in dependency-safe execution order.""" 

25 definitions = ( 

26 ActionDefinition( 

27 "preflight", 

28 "Verify exact git, account, configuration, and ownership identity", 

29 (), 

30 action_preflight, 

31 ), 

32 ActionDefinition( 

33 "static", 

34 "Run the offline example checks (parse, transport gates, catalog symmetry)", 

35 (), 

36 action_static, 

37 ), 

38 ActionDefinition( 

39 "baseline", 

40 "Capture protected CloudFormation and ECR baselines", 

41 ("preflight",), 

42 action_baseline, 

43 ), 

44 ActionDefinition( 

45 "deploy", 

46 "Deploy the configured GCO topology plus example-required overrides", 

47 ("baseline", "static"), 

48 action_deploy, 

49 ), 

50 ActionDefinition( 

51 "examples", 

52 "Run every selected example through its documented submission path", 

53 ("deploy",), 

54 action_examples, 

55 ), 

56 ActionDefinition( 

57 "destroy", 

58 "Destroy all run-owned infrastructure in dependency order", 

59 ("deploy",), 

60 action_destroy, 

61 ), 

62 ActionDefinition( 

63 "final-inventory", 

64 "Verify zero residual resources and exact baseline preservation", 

65 ("destroy",), 

66 action_final_inventory, 

67 ), 

68 ) 

69 return {definition.name: definition for definition in definitions}