feat(db): add projects and project links tables #263

Closed
opened 2026-02-22 23:40:41 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit: feat(db): add projects and project links tables
  • Branch: feature/m1-project-db

Subtasks

  • Add Alembic migration for ns_projects and project_resource_links with explicit down_revision to latest head. Done: Day 7, February 15, 2026
  • Define ns_projects columns: namespaced_name PK, namespace, description, invariants_json (nullable), automation_profile (nullable), invariant_actor (nullable), context_policy_json (nullable), tags_json, created_by, timestamps. Done: Day 7, February 15, 2026
  • Define project_resource_links columns: link_id ULID, project_name FK, resource_id FK, alias, read_only, created_at. Done: Day 7, February 15, 2026
  • Add uniqueness constraint on (project_name, resource_id) and index on (project_name, alias). Done: Day 7, February 15, 2026
  • Add indexes on project_resource_links.project_name and project_resource_links.resource_id for joins. Done: Day 7, February 15, 2026
  • Add ORM models NamespacedProjectModel and ProjectResourceLinkModel with to_domain()/from_domain() mapping to NamespacedProject + link model and proper JSON field handling. Done: Day 7, February 15, 2026
  • Document project tables and link constraints in docs/reference/database_schema.md. Done: Day 7, February 15, 2026
  • Tests (Behave): Add migration scenarios verifying project tables and link uniqueness. Done: Day 7, February 15, 2026
  • Tests (Robot): Add Robot migration smoke test that inserts a project and link row. Done: Day 7, February 15, 2026
  • Tests (ASV): Add benchmarks/project_migration_bench.py for migration baseline. Done: Day 7, February 15, 2026
  • Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes. Done: Day 7, February 15, 2026
  • Verify coverage >=97% via nox -s coverage_report. Done: Day 7, February 15, 2026

Section: ### Section 4: Projects & Resources [WORKSTREAM B - Hamza Lead]
Status: Completed

## Metadata - **Commit**: `feat(db): add projects and project links tables` - **Branch**: `feature/m1-project-db` ## Subtasks - [x] Add Alembic migration for `ns_projects` and `project_resource_links` with explicit down_revision to latest head. Done: Day 7, February 15, 2026 - [x] Define `ns_projects` columns: `namespaced_name` PK, `namespace`, `description`, `invariants_json` (nullable), `automation_profile` (nullable), `invariant_actor` (nullable), `context_policy_json` (nullable), `tags_json`, `created_by`, timestamps. Done: Day 7, February 15, 2026 - [x] Define `project_resource_links` columns: `link_id` ULID, `project_name` FK, `resource_id` FK, `alias`, `read_only`, `created_at`. Done: Day 7, February 15, 2026 - [x] Add uniqueness constraint on (`project_name`, `resource_id`) and index on (`project_name`, `alias`). Done: Day 7, February 15, 2026 - [x] Add indexes on `project_resource_links.project_name` and `project_resource_links.resource_id` for joins. Done: Day 7, February 15, 2026 - [x] Add ORM models `NamespacedProjectModel` and `ProjectResourceLinkModel` with `to_domain()`/`from_domain()` mapping to `NamespacedProject` + link model and proper JSON field handling. Done: Day 7, February 15, 2026 - [x] Document project tables and link constraints in `docs/reference/database_schema.md`. Done: Day 7, February 15, 2026 - [x] Tests (Behave): Add migration scenarios verifying project tables and link uniqueness. Done: Day 7, February 15, 2026 - [x] Tests (Robot): Add Robot migration smoke test that inserts a project and link row. Done: Day 7, February 15, 2026 - [x] Tests (ASV): Add `benchmarks/project_migration_bench.py` for migration baseline. Done: Day 7, February 15, 2026 - [x] Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes. Done: Day 7, February 15, 2026 - [x] Verify coverage >=97% via `nox -s coverage_report`. Done: Day 7, February 15, 2026 **Section**: ### Section 4: Projects & Resources [WORKSTREAM B - Hamza Lead] **Status**: Completed
freemo added this to the v3.0.0 milestone 2026-02-22 23:40:41 +00:00
freemo self-assigned this 2026-02-22 23:40:41 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#353 Epic: Projects & Resources B0-B2
cleveragents/cleveragents-core
Depends on
Reference
cleveragents/cleveragents-core#263
No description provided.