Feature: Rename BoardItemType 'issue' to 'ticket' -- enum, schema, routes, migration #229
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#229
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
Child of
forgejo_admin/claude-custom#181(parent decomposition ticket).Deploy order: A of 4 -- this ships first. SDK (B), MCP (C), and hooks (D) depend on this.
Repo
forgejo_admin/pal-e-apiUser Story
As a platform developer,
I want
BoardItemType.ticketinstead ofBoardItemType.issue,So that board items are semantically distinct from Forgejo issues and note-type "issue" tags.
Context
The
BoardItemTypeenum usesissueas a value, but this collides with two other meanings: Forgejo issues (the ticket tracker) and theissuenote type. The rename toticketresolves this ambiguity across the full stack. This is the API-layer change that all downstream consumers (SDK, MCP, hooks) depend on.The enum is stored as a non-native string column (
Enum(BoardItemType, native_enum=False, length=20)), so the Alembic migration is a simpleUPDATEon string values -- no Postgres enum ALTER needed.During the transition period, the API must accept both
"issue"and"ticket"so downstream consumers are not broken before they update.File Targets
Files the agent should modify or create:
src/pal_e_docs/models.pyline 37 -- renameissue = "issue"toticket = "ticket"src/pal_e_docs/schemas.pyline 232 -- updateBoardItemTypeTypeLiteral to replace"issue"with"ticket"src/pal_e_docs/routes/boards.pylines 131, 137, 372, 488, 564, 570, 643 -- allBoardItemType.issuereferences becomeBoardItemType.ticketsrc/pal_e_docs/routes/boards.pyvalidation endpoints (~lines 131, 564) -- add transition alias: accept"issue"as input, map toBoardItemType.ticket, log deprecationalembic/versions/XXX_rename_board_item_type_issue_to_ticket.py--UPDATE board_items SET item_type='ticket' WHERE item_type='issue'tests/test_boards.py-- ~20 references toitem_type="issue"in fixtures and assertionstests/test_board_issue_sync.py-- ~7 references toitem_type="issue"in query params and assertionstests/test_pagination_activity.pyline 49 --"item_type": "issue""issue", get"ticket"back)Files the agent should NOT touch:
src/pal_e_docs/routes/notes.pyline 50 -- NoteType status map, not BoardItemTypetests/test_note_type_enum.py-- NoteType enum, not BoardItemTypetests/test_note_decomposition.py-- NoteType references, not BoardItemTypetests/test_template_renderer.py-- NoteType badge color map, not BoardItemTypeAcceptance Criteria
BoardItemType.ticketis the canonical enum value inmodels.pyBoardItemTypeTypeLiteral inschemas.pyuses"ticket"BoardItemType.issuereferences inroutes/boards.pyare updatedissuerows toticket"issue"and"ticket"during transition"ticket"substitutedalembic upgrade headsucceeds on fresh and existing databasesTest Expectations
test_boards.pytests pass with"ticket"as the item_typetest_board_issue_sync.pytests pass with"ticket"item_type="issue"and verifies API accepts it and returns"ticket"alembic upgrade headthenalembic downgrade -1round-trips cleanlypytest tests/test_boards.py tests/test_board_issue_sync.py tests/test_pagination_activity.py -vConstraints
ALTER TYPEneeded, justUPDATEon data"issue"->BoardItemType.ticketat the route validation layer, not in the enum itselfissueas a second enum member -- that defeats the purposeChecklist
Related
forgejo_admin/claude-custom#181-- parent decomposition ticketpal-e-docs-- project this affects