Add Repo entity with schema, API, and migration #10

Merged
forgejo_admin merged 1 commit from 9-add-repo-entity-with-schema-api-and-migr into main 2026-02-24 20:03:56 +00:00
Contributor

Summary

  • Add Repo SQLAlchemy model with name, slug, platform, url, status, role, project_id
  • Add Pydantic schemas: RepoCreate, RepoUpdate, RepoOut
  • Add CRUD API routes at /repos with ?project=slug and ?status=active filters
  • Add Alembic migration to create repos table with seed data for all 8 existing repos
  • Register repos router in main.py, import Repo in alembic/env.py

Files Changed

  • src/pal_e_docs/models.py — Add Repo model + repos relationship on Project
  • src/pal_e_docs/schemas.py — Add RepoCreate, RepoUpdate, RepoOut
  • src/pal_e_docs/routes/repos.py — New file: CRUD endpoints
  • src/pal_e_docs/main.py — Register repos router
  • alembic/env.py — Import Repo model
  • alembic/versions/a1b2c3d4e5f6_add_repos_table.py — Migration + seed data

Seed Data

Repo Platform Project Role
pal-e-platform github pal-e-platform OpenTofu IaC
pal-e-services github pal-e-services OpenTofu IaC
pal-e-docs app forgejo pal-e-docs FastAPI app
pal-e-docs-mcp github pal-e-docs MCP server
claude-custom forgejo claude-config Hooks/skills/config
forgejo-sdk github claude-config Python SDK
forgejo-mcp github claude-config MCP server
basketball-api forgejo pal-e-services Service app

Test plan

  • GET /repos returns all 8 seeded repos
  • GET /repos?project=pal-e-docs returns 2 repos (app + mcp)
  • GET /repos?status=active returns all 8
  • GET /repos/pal-e-docs-app returns single repo with project
  • POST /repos creates new repo
  • PUT /repos/{slug} updates repo
  • DELETE /repos/{slug} removes repo (204)
  • Duplicate slug returns 409

Closes #9

🤖 Generated with Claude Code

## Summary - Add `Repo` SQLAlchemy model with name, slug, platform, url, status, role, project_id - Add Pydantic schemas: `RepoCreate`, `RepoUpdate`, `RepoOut` - Add CRUD API routes at `/repos` with `?project=slug` and `?status=active` filters - Add Alembic migration to create `repos` table with seed data for all 8 existing repos - Register repos router in `main.py`, import `Repo` in `alembic/env.py` ## Files Changed - `src/pal_e_docs/models.py` — Add `Repo` model + `repos` relationship on `Project` - `src/pal_e_docs/schemas.py` — Add `RepoCreate`, `RepoUpdate`, `RepoOut` - `src/pal_e_docs/routes/repos.py` — New file: CRUD endpoints - `src/pal_e_docs/main.py` — Register repos router - `alembic/env.py` — Import `Repo` model - `alembic/versions/a1b2c3d4e5f6_add_repos_table.py` — Migration + seed data ## Seed Data | Repo | Platform | Project | Role | |------|----------|---------|------| | pal-e-platform | github | pal-e-platform | OpenTofu IaC | | pal-e-services | github | pal-e-services | OpenTofu IaC | | pal-e-docs app | forgejo | pal-e-docs | FastAPI app | | pal-e-docs-mcp | github | pal-e-docs | MCP server | | claude-custom | forgejo | claude-config | Hooks/skills/config | | forgejo-sdk | github | claude-config | Python SDK | | forgejo-mcp | github | claude-config | MCP server | | basketball-api | forgejo | pal-e-services | Service app | ## Test plan - [ ] `GET /repos` returns all 8 seeded repos - [ ] `GET /repos?project=pal-e-docs` returns 2 repos (app + mcp) - [ ] `GET /repos?status=active` returns all 8 - [ ] `GET /repos/pal-e-docs-app` returns single repo with project - [ ] `POST /repos` creates new repo - [ ] `PUT /repos/{slug}` updates repo - [ ] `DELETE /repos/{slug}` removes repo (204) - [ ] Duplicate slug returns 409 Closes #9 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add Repo entity with model, API routes, migration, and seed data (#9)
Some checks failed
ci/woodpecker/pr/woodpecker Pipeline failed
238d7537f8
Repos become first-class entities with name, slug, platform, url,
status, role, and project association. Includes CRUD API routes with
project and status filters, Alembic migration with seed data for all
8 existing repos.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
forgejo_admin deleted branch 9-add-repo-entity-with-schema-api-and-migr 2026-02-24 20:03:56 +00:00
Commenting is not possible because the repository is archived.
No description provided.