Get all passing features for webhook notifications. Args: project_dir: Directory containing the project Returns: List of dicts with id, category, name for each passing feature
(project_dir: Path)
| 113 | |
| 114 | |
| 115 | def get_all_passing_features(project_dir: Path) -> list[dict]: |
| 116 | """ |
| 117 | Get all passing features for webhook notifications. |
| 118 | |
| 119 | Args: |
| 120 | project_dir: Directory containing the project |
| 121 | |
| 122 | Returns: |
| 123 | List of dicts with id, category, name for each passing feature |
| 124 | """ |
| 125 | from autoforge_paths import get_features_db_path |
| 126 | db_file = get_features_db_path(project_dir) |
| 127 | if not db_file.exists(): |
| 128 | return [] |
| 129 | |
| 130 | try: |
| 131 | with closing(_get_connection(db_file)) as conn: |
| 132 | cursor = conn.cursor() |
| 133 | cursor.execute( |
| 134 | "SELECT id, category, name FROM features WHERE passes = 1 ORDER BY priority ASC" |
| 135 | ) |
| 136 | features = [ |
| 137 | {"id": row[0], "category": row[1], "name": row[2]} |
| 138 | for row in cursor.fetchall() |
| 139 | ] |
| 140 | return features |
| 141 | except Exception: |
| 142 | return [] |
| 143 | |
| 144 | |
| 145 | def send_progress_webhook(passing: int, total: int, project_dir: Path) -> None: |
no test coverage detected