Load the configuration from the shared configuration JSON file.
(self)
| 1519 | if not needs_regen: |
| 1520 | # actions.json is up to date — just load status_list from it |
| 1521 | self._load_status_list_from_actions_json() |
| 1522 | logger.info("actions.json is up to date — skipped regeneration") |
| 1523 | return |
| 1524 | except Exception as e: |
| 1525 | logger.debug(f"Actions freshness check failed, regenerating: {e}") |
| 1526 | # Fall through: regenerate |
| 1527 | self.generate_actions_json() |
| 1528 | |
| 1529 | def generate_actions_json(self): |
| 1530 | """Generate the actions JSON file, it will be used to store the actions configuration.""" |
| 1531 | actions_dir = self.actions_dir |
| 1532 | actions_config = [] |
| 1533 | try: |
| 1534 | for filename in os.listdir(actions_dir): |
| 1535 | if filename.endswith('.py') and filename != '__init__.py': |
| 1536 | module_name = filename[:-3] |
| 1537 | try: |
| 1538 | module = importlib.import_module(f'actions.{module_name}') |
| 1539 | if getattr(module, 'BYPASS_ACTION_MODULE', False): |
| 1540 | logger.debug(f"Skipping helper module {module_name} (BYPASS_ACTION_MODULE)") |
| 1541 | continue |
| 1542 | |
| 1543 | b_class = getattr(module, 'b_class', None) |
| 1544 | b_status = getattr(module, 'b_status', None) |
| 1545 | if not b_class or not b_status: |
| 1546 | logger.debug(f"Skipping module {module_name} without action metadata") |
| 1547 | continue |
| 1548 | |
| 1549 | b_port = getattr(module, 'b_port', None) |
| 1550 | b_parent = getattr(module, 'b_parent', None) |
| 1551 | actions_config.append({ |
| 1552 | "b_module": module_name, |
| 1553 | "b_class": b_class, |
no test coverage detected