Update board API to use board notes instead of boards table #197
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api#197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — board-pal-e-docs kanban unification. Depends on: "Add board_note_id FK"
Repo
forgejo_admin/pal-e-docsUser Story
As an API consumer (frontend, MCP, SDK)
I want the board API to read/write against board notes
So that the migration is transparent and boards participate in the note system
Context
After board_note_id is populated, the 14 board API endpoints switch from querying the boards table to querying notes where note_type="board". Board CRUD becomes note CRUD with a type filter. Board item endpoints use board_note_id instead of board_id.
Key decision: board API routes stay at /boards/{slug} for backwards compatibility, but internally query notes. Or, board operations become note operations and /boards is an alias.
File Targets
Files to modify:
src/pal_e_docs/routes/boards.py— all 14 endpoints switch to note-based queriessrc/pal_e_docs/schemas.py— BoardOut may change to include note fields (parent_slug, tags, etc.)Files NOT to touch:
src/pal_e_docs/routes/notes.py— note CRUD already handles board notes via note_typesrc/pal_e_docs/models.py— model changes were in the previous ticketAcceptance Criteria
Test Expectations
pytest tests/test_boards.py -vConstraints
Checklist
Related
project-pal-e-docs— API layer of kanban unificationScope Review: NEEDS_REFINEMENT
Review note:
review-316-2026-03-24Template is complete, file targets verified (14 endpoints confirmed, both files exist), dependencies correctly sequenced (#195/#196 done, #198/#199 downstream). Three issues block agent execution:
scripts/migrate_boards_to_notes.pymust run to populate board_note_id before this API change works. Not mentioned in the ticket.Optional: add acceptance criteria for cross-board endpoints (backlog/items, activity), mention _board_to_out/_item_to_out helper rewrites in File Targets.
Review Refinements (from review-316-2026-03-24)
Decision 1: Architecture — keep /boards routes, query notes internally
Keep all 14
/boards/{slug}routes at the same URLs with the same response shapes. Internally, switch from queryingboardstable to queryingnotes WHERE note_type='board'. The boards table still exists during this ticket — final removal is #199.This means: same API contract for all consumers (SDK, MCP, frontend). No breaking changes. The transition is invisible to callers.
Decision 2: Migration script prerequisite
scripts/migrate_boards_to_notes.py(from PR #207) must be run on production BEFORE this ticket's PR is deployed. The agent should:board_note_idgracefully (log warning, skip item) as a safety netDecision 3: Response contract — additive, not breaking
During transition (this ticket):
BoardOutaddsnote_id: intfield (the board note's ID). Existingidfield stays (boards table ID).BoardItemOut—board_idstays,board_note_idadded (already in the model from #196).Final cleanup in #199 (drop boards table): remove
id(boards table ID) from BoardOut, removeboard_idfrom BoardItemOut. Renamenote_id→id,board_note_id→board_id.Updated Acceptance Criteria
Scope Review: READY
Review note:
review-316-2026-03-24(updated from NEEDS_REFINEMENT)All three blockers resolved by decisions in comment #6640. Architecture (keep /boards routes, query notes internally), migration prerequisite (documented + NULL graceful handling), and response contract (additive fields, existing preserved) are all verified against the codebase.
board_note_idFK exists at models.py line 259, migration script existsboard_idin responses — additive schema change is safeTicket is ready for agent execution.