feat: add 4 new NoteTypes + validation BoardColumn #226
No reviewers
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!226
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "223-add-note-types-and-validation-column"
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?
Summary
validationto the BoardColumn enum to align code with the kanban SOPChanges
src/pal_e_docs/schemas.py: added 4 new values to NoteType Literal (alphabetically sorted), addedvalidationto BoardColumnType Literalsrc/pal_e_docs/models.py: addedvalidationto BoardColumn enum afterneeds_approvalsrc/pal_e_docs/routes/notes.py: added VALID_STATUSES entries for review, architecture, validation, user-storyalembic/versions/r8m9n0o1p2q3_add_validation_board_column.py: Alembic migration for BoardColumn enum expansion (no-op on SQLite, documents the change for revision tracking)tests/test_note_type_enum.py: added 18 new tests for create/update, status validation, and board validation columnTest Plan
Review Checklist
Related Notes
forgejo_admin/pal-e-api #223-- the Forgejo issue this PR implementsproject-pal-e-agency-- the project this work belongs toforgejo_admin/claude-custom #180-- parent spike (note type system audit)Closes #223
QA Review
Diff Analysis
5 files changed, +250/-14 -- focused, no scope creep.
schemas.py(NoteType)schemas.py(BoardColumnType)validationadded beforedonemodels.py(BoardColumn)validationenum value addedroutes/notes.py(VALID_STATUSES)alembic/versions/r8m9...pytests/test_note_type_enum.pyChecks
Nits
None.
VERDICT: APPROVE
PR #226 Review
DOMAIN REVIEW
Tech stack: Python / FastAPI / SQLAlchemy / Alembic / Pydantic / pytest
This PR adds 4 new note types (
review,architecture,validation,user-story) to theNoteTypeLiteral andVALID_STATUSESdict, plus avalidationcolumn to theBoardColumnenum andBoardColumnTypeLiteral. Five files changed across schemas, models, routes, migration, and tests.Consistency check -- all four touchpoints align:
reviewarchitecturevalidation(type)user-storyvalidation(column)schemas.pyNoteType Literalnotes.pyVALID_STATUSES dictmodels.pyBoardColumn enumschemas.pyBoardColumnType LiteralNo inconsistencies detected. The NoteType Literal is now alphabetically sorted, which is a good cleanup.
Alembic migration (
r8m9n0o1p2q3):down_revision = "q7l8m9n0o1p2"correctly chains to the previous migration (q7l8m9n0o1p2_add_board_note_id_to_board_items.py).upgrade()is a no-op for SQLite (correct --native_enum=Falsestores as VARCHAR with no CHECK constraint on SQLite). Comments document the PostgreSQL path for future reference.downgrade()correctly movesvalidationitems back toneeds_approvalbefore reverting -- good data safety practice.Enum(BoardColumn, native_enum=False, length=20)in the model: the longest enum value isneeds_approvalat 14 chars;validationat 10 chars fits within the 20-char VARCHAR. No length issue.Status validation logic:
review:["active", "archived"]-- reasonable for QA review notes.architecture:["active", "archived", "draft"]-- draft makes sense for architecture docs in progress.validation:["active", "archived"]-- consistent with review.user-story:["active", "archived", "draft"]-- draft makes sense for stories being refined.SQLAlchemy patterns: No session management issues. The enum expansion is handled correctly through the non-native enum approach. No new relationships or loading patterns introduced.
FastAPI patterns: No new endpoints added. Existing
_validate_status()function handles the new types through the existing dict lookup -- no code duplication.BLOCKERS
None.
NITS
Migration revision ID format: The revision ID
r8m9n0o1p2q3follows the project's existing hand-crafted pattern (sequential alphanumeric). This is consistent with prior migrations, but worth noting that Alembic's--autogenerateuses random hex. Not a problem, just a style observation.Test count claim: The PR body says "18 new tests." The actual breakdown is 4 new parametrized entries x 2 parametrized tests = 8 cases, plus 10 named test functions = 18 total new test cases. The count is correct, but the distinction between "test functions" (10 new) and "test cases" (18 new) could be clearer for future readers. Minor.
"validation"appears as both a NoteType and a BoardColumn value: This is intentional (avalidationnote type for validation report notes, and avalidationkanban column for the board workflow), but the dual meaning could confuse future contributors. A one-line comment inVALID_STATUSESorBoardColumnclarifying the distinction would help. Non-blocking.SOP COMPLIANCE
223-add-note-types-and-validation-columnreferences issue #223project-pal-e-agencyand parent spikeforgejo_admin/claude-custom #180feat:)PROCESS OBSERVATIONS
VERDICT: APPROVED