List all projects that have valid, accessible paths. Returns: List of project info dicts with additional 'name' field.
()
| 517 | |
| 518 | |
| 519 | def list_valid_projects() -> list[dict[str, Any]]: |
| 520 | """ |
| 521 | List all projects that have valid, accessible paths. |
| 522 | |
| 523 | Returns: |
| 524 | List of project info dicts with additional 'name' field. |
| 525 | """ |
| 526 | _, SessionLocal = _get_engine() |
| 527 | session = SessionLocal() |
| 528 | try: |
| 529 | projects = session.query(Project).all() |
| 530 | valid = [] |
| 531 | for p in projects: |
| 532 | path = Path(p.path) |
| 533 | is_valid, _ = validate_project_path(path) |
| 534 | if is_valid: |
| 535 | valid.append({ |
| 536 | "name": p.name, |
| 537 | "path": p.path, |
| 538 | "created_at": p.created_at.isoformat() if p.created_at else None |
| 539 | }) |
| 540 | return valid |
| 541 | finally: |
| 542 | session.close() |
| 543 | |
| 544 | |
| 545 | # ============================================================================= |
nothing calls this directly
no test coverage detected