Drop legacy boards table — complete kanban unification #199

Open
opened 2026-03-24 16:51:11 +00:00 by forgejo_admin · 3 comments

Type

Feature

Lineage

Standalone — board-pal-e-docs kanban unification. Depends on: all previous migration tickets

Repo

forgejo_admin/pal-e-api

User Story

As the platform owner
I want the legacy boards table removed
So that there's one source of truth — notes — and the recursive kanban architecture is clean

Context

Final cleanup after all consumers are migrated. Removes the boards table, drops the board_id column from board_items, and removes the dual-FK transition state. After this, boards ARE notes. Any note can have board items. Recursive kanban is fully enabled.

This also enables: sub-projects with their own boards, kanban within tickets, phase-level boards for complex phases.

File Targets

Source files to modify:

  • src/pal_e_docs/models.py — remove Board model, remove board_id from BoardItem
  • src/pal_e_docs/schemas.py — remove BoardCreate/BoardUpdate if merged into note schemas
  • src/pal_e_docs/routes/boards.py — heaviest change (126 board_id/Board refs); rewrite all CRUD to use board_note_id exclusively
  • alembic/versions/ — migration to drop boards table and board_id column

Test files requiring updates (8 files reference Board/board_id):

  • tests/test_boards.py
  • tests/test_board_sync.py
  • tests/test_board_issue_sync.py
  • tests/test_private_projects_boards.py
  • tests/test_pagination_activity.py
  • tests/test_note_type_enum.py
  • tests/test_retype_migration.py
  • tests/conftest.py

Cross-Repo Blast Radius

pal-e-app consumes board_id in 2 files — these will break when the field is removed:

  • src/lib/api-client.tsboard_id: number; in type definition (line 40)
  • src/routes/+page.svelteboardMap[item.board_id] lookup (line 139)

Resolved: Alias board_note_id as board_id in API responses for backward compatibility. Add deprecation warning header. pal-e-app migrates in a follow-up ticket. No coordinated breaking change.

If coordinated breaking change: a separate pal-e-app issue is needed to update api-client.ts and +page.svelte before or alongside this PR.

Acceptance Criteria

  • boards table no longer exists
  • board_items.board_id column removed
  • board_items.board_note_id is the only FK to notes
  • API response schemas include board_id as a deprecated alias for board_note_id, with X-Deprecated-Field response header
  • All tests pass without boards table
  • Creating a board note and adding items works end-to-end

Test Expectations

  • Full test suite passes
  • E2E: create board note → add items → move items → sync → verify
  • Run: pytest tests/ -v

Constraints

  • Only run after ALL consumers confirmed working with note-backed boards
  • Point of no return — back up DB before migration
  • Follow sop-postgres-restore if rollback needed
  • Cross-repo dependency: pal-e-app consumes board_id (see Cross-Repo Blast Radius above) and needs coordinated update

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-pal-e-docs — final step of kanban unification
  • Unlocks: recursive kanban, sub-project boards, kanban within tickets

Notes for Betty Sue

  • Board item #318 needs arch:board-api label added
### Type Feature ### Lineage Standalone — board-pal-e-docs kanban unification. Depends on: all previous migration tickets ### Repo `forgejo_admin/pal-e-api` ### User Story As the platform owner I want the legacy boards table removed So that there's one source of truth — notes — and the recursive kanban architecture is clean ### Context Final cleanup after all consumers are migrated. Removes the boards table, drops the board_id column from board_items, and removes the dual-FK transition state. After this, boards ARE notes. Any note can have board items. Recursive kanban is fully enabled. This also enables: sub-projects with their own boards, kanban within tickets, phase-level boards for complex phases. ### File Targets Source files to modify: - `src/pal_e_docs/models.py` — remove Board model, remove board_id from BoardItem - `src/pal_e_docs/schemas.py` — remove BoardCreate/BoardUpdate if merged into note schemas - `src/pal_e_docs/routes/boards.py` — heaviest change (126 board_id/Board refs); rewrite all CRUD to use board_note_id exclusively - `alembic/versions/` — migration to drop boards table and board_id column Test files requiring updates (8 files reference Board/board_id): - `tests/test_boards.py` - `tests/test_board_sync.py` - `tests/test_board_issue_sync.py` - `tests/test_private_projects_boards.py` - `tests/test_pagination_activity.py` - `tests/test_note_type_enum.py` - `tests/test_retype_migration.py` - `tests/conftest.py` ### Cross-Repo Blast Radius **pal-e-app** consumes `board_id` in 2 files — these will break when the field is removed: - `src/lib/api-client.ts` — `board_id: number;` in type definition (line 40) - `src/routes/+page.svelte` — `boardMap[item.board_id]` lookup (line 139) **Resolved:** Alias board_note_id as board_id in API responses for backward compatibility. Add deprecation warning header. pal-e-app migrates in a follow-up ticket. No coordinated breaking change. If coordinated breaking change: a separate pal-e-app issue is needed to update api-client.ts and +page.svelte before or alongside this PR. ### Acceptance Criteria - [ ] boards table no longer exists - [ ] board_items.board_id column removed - [ ] board_items.board_note_id is the only FK to notes - [ ] API response schemas include board_id as a deprecated alias for board_note_id, with X-Deprecated-Field response header - [ ] All tests pass without boards table - [ ] Creating a board note and adding items works end-to-end ### Test Expectations - [ ] Full test suite passes - [ ] E2E: create board note → add items → move items → sync → verify - Run: `pytest tests/ -v` ### Constraints - Only run after ALL consumers confirmed working with note-backed boards - Point of no return — back up DB before migration - Follow sop-postgres-restore if rollback needed - **Cross-repo dependency:** pal-e-app consumes board_id (see Cross-Repo Blast Radius above) and needs coordinated update ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-pal-e-docs` — final step of kanban unification - Unlocks: recursive kanban, sub-project boards, kanban within tickets ### Notes for Betty Sue - Board item #318 needs `arch:board-api` label added
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-318-2026-03-27
Missing file target (routes/boards.py has 41 board_id/Board references) and cross-repo blast radius in pal-e-app (2 files use board_id).

  • [BODY] Add src/pal_e_docs/routes/boards.py to File Targets -- heaviest change, not listed
  • [BODY] Add tests/ to File Targets -- 8 test files reference Board/board_id
  • [BODY] Add AC: "API response schemas no longer include board_id field"
  • [BODY] Note in Constraints: pal-e-app consumes board_id and needs coordinated update
  • [LABEL] Add arch:board-api label to board item #318
  • [SCOPE] Clarify: breaking change or backward-compat alias for board_id?
  • [SCOPE] Create separate pal-e-app issue for board_id removal (api-client.ts, +page.svelte)
## Scope Review: NEEDS_REFINEMENT Review note: `review-318-2026-03-27` Missing file target (routes/boards.py has 41 board_id/Board references) and cross-repo blast radius in pal-e-app (2 files use board_id). - **[BODY]** Add `src/pal_e_docs/routes/boards.py` to File Targets -- heaviest change, not listed - **[BODY]** Add `tests/` to File Targets -- 8 test files reference Board/board_id - **[BODY]** Add AC: "API response schemas no longer include board_id field" - **[BODY]** Note in Constraints: pal-e-app consumes board_id and needs coordinated update - **[LABEL]** Add `arch:board-api` label to board item #318 - **[SCOPE]** Clarify: breaking change or backward-compat alias for board_id? - **[SCOPE]** Create separate pal-e-app issue for board_id removal (api-client.ts, +page.svelte)
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-318-2026-03-27
Re-review after refinement. Template is complete and file targets mostly verified, but 3 fixable issues remain before this can move to next_up.

  • [BODY] ### Repo says forgejo_admin/pal-e-docs — should be forgejo_admin/pal-e-api (repo was renamed)
  • [BODY] notes.py listed as file target with "2 board_id refs" — grep finds 0 board_id/Board refs. Remove or clarify.
  • [SCOPE] AC #4 ("API response schemas no longer include board_id field") contradicts Cross-Repo Blast Radius alias decision ("Alias board_note_id as board_id for backward compat"). Human decision needed: rewrite AC #4 to allow alias, or drop alias and create coordinated pal-e-app ticket.
  • [LABEL] Board item #318 missing arch:board-api label
## Scope Review: NEEDS_REFINEMENT Review note: `review-318-2026-03-27` Re-review after refinement. Template is complete and file targets mostly verified, but 3 fixable issues remain before this can move to next_up. - **[BODY]** `### Repo` says `forgejo_admin/pal-e-docs` — should be `forgejo_admin/pal-e-api` (repo was renamed) - **[BODY]** `notes.py` listed as file target with "2 board_id refs" — grep finds 0 board_id/Board refs. Remove or clarify. - **[SCOPE]** AC #4 ("API response schemas no longer include board_id field") contradicts Cross-Repo Blast Radius alias decision ("Alias board_note_id as board_id for backward compat"). Human decision needed: rewrite AC #4 to allow alias, or drop alias and create coordinated pal-e-app ticket. - **[LABEL]** Board item #318 missing `arch:board-api` label
Author
Owner

Scope Review: READY

Review note: review-318-2026-03-27-v3
V3 re-review: all 4 issues from v2 are resolved. Template complete, all 12 source+test file targets verified, cross-repo blast radius documented with alias approach, dependency chain (#314-#317) satisfied.

  • [LABEL] Add arch:board-api label to board item #318 before moving to next_up (per Notes for Betty Sue)
## Scope Review: READY Review note: `review-318-2026-03-27-v3` V3 re-review: all 4 issues from v2 are resolved. Template complete, all 12 source+test file targets verified, cross-repo blast radius documented with alias approach, dependency chain (#314-#317) satisfied. - **[LABEL]** Add `arch:board-api` label to board item #318 before moving to next_up (per Notes for Betty Sue)
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.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-api#199
No description provided.