fix: remove 7 deprecated NoteTypes from enum #231
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!231
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "225-remove-deprecated-note-types"
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
Changes
src/pal_e_docs/schemas.py: Remove 7 values from NoteType Literalsrc/pal_e_docs/routes/notes.py: Remove 7 entries from VALID_STATUSES dicttests/test_note_type_enum.py: Rewrite with parametrized tests for removed types returning 422, legacy notes still queryable, frozen types still acceptedtests/test_note_decomposition.py: Remove issue/todo from valid_types and parametric status validationtests/test_include_cold.py: Replace todo seed notes with phase/doc; insert legacy done-todo directly into DB for cold-status coveragetests/test_blocks_compiled_pages.py: Replace todo with doc in parent-child hierarchy testtests/test_board_sync.py: Replace todo with doc in non-phase child sync testTest Plan
Review Checklist
Related Notes
pal-e-api-- the project this work belongs toQA Review
Scope check: 7 types removed (reference, incident, journal, post, todo, issue, milestone) from NoteType Literal and VALID_STATUSES. Plan/phase frozen, not removed. No alembic migration (correct -- plain String column). No frontend changes (correct -- different repo).
Test coverage:
Code quality:
No issues found.
VERDICT: APPROVE
PR #231 Review
DOMAIN REVIEW
Tech stack: Python / FastAPI / SQLAlchemy / Pydantic / pytest
This PR removes 7 deprecated values from the
NoteTypeLiteral (reference, incident, journal, post, todo, issue, milestone) and the correspondingVALID_STATUSESentries. The enforcement strategy is sound:NoteCreateandNoteUpdateuseNoteType(the strict Literal), so new creation/update with removed types returns 422. No DB migration required becausenote_typeis a plainStringcolumn (models.py:102), not a DB-level enum.NoteOut.note_typeisstr | None(schemas.py:137), so old values serialize fine on reads. GET query params arestr | None(routes/notes.py:366,433,566), so?note_type=todostill works for filtering legacy data.The 5 test files are updated consistently. All references to removed types in test seed data are replaced with valid types (doc, phase). Where cold-status coverage requires a "done" note, the test correctly inserts directly into DB via
TestingSessionLocalto simulate pre-existing legacy data.DRY check:
_VALID_STATUSESintest_note_decomposition.pyis a duplicate of the route'sVALID_STATUSESdict (minus newer types). This pre-dates this PR and is not introduced here -- not a blocker.BLOCKERS
None.
NITS
test_include_cold.py:113comment says "All 10 notes" -- the seed function creates 9 notes via API + 1 via direct DB insert = 10 total. Count is correct, but it would be slightly clearer to add a comment noting the DB-inserted note. Very minor.test_note_decomposition.py_VALID_STATUSESdrift risk: This dict (test_note_decomposition.py:752) does not include board, review, architecture, validation, or user-story. Those are covered elsewhere (test_note_type_enum.py), but the partial duplication of the route'sVALID_STATUSESis a maintenance risk. Pre-existing, not introduced by this PR.Two removed comments in
test_note_type_enum.py(lines 401, 410 in the diff --# Setup: create project...and# Move to validation column): These were useful inline context. Removing them is fine but not necessary.SOP COMPLIANCE
225-remove-deprecated-note-types-> issue #225)PROCESS OBSERVATIONS
board_synctests) -- these are unrelated but should be tracked for resolution to avoid normalization of failure.VERDICT: APPROVED