Add slug rename support to note update API #23
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#23
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?
Plan
plan-2026-02-25-agent-profiles— Phase 3.5This is a prerequisite for renaming SOP slugs to use a consistent
sop-prefix convention (e.g.,worktree-workflow→sop-worktree-workflow).User Story
As a platform operator
I need to rename note slugs via the update API
So that I can enforce consistent slug naming conventions (e.g.,
sop-prefix) without deleting and recreating notes, which would lose revision history and break link referencesAcceptance Criteria
When I PUT
/notes/{slug}with aslugfield in the body (e.g.,{"slug": "sop-worktree-workflow"})Then the note's slug is updated and the note is accessible at the new slug
When I PUT
/notes/{slug}with aslugthat already belongs to a different noteThen I get a 409 Conflict response
When I PUT
/notes/{slug}with the same slug as the current note (no-op rename)Then the update succeeds without error
When I call
mcp__pal-e-docs__update_note(slug="old-slug", new_slug="new-slug")Then the MCP tool sends the slug rename to the API and returns the updated note at the new slug
Additional Information
pal-e-docs API repo (
forgejo_admin/pal-e-docs):NoteUpdateinsrc/pal_e_docs/schemas.py(line 81-86) — addslug: str | None = Noneupdate_noteinsrc/pal_e_docs/routes/notes.py(line 96-134) — add slug update logic with uniqueness check (409 if conflict)Note.slugisunique=True, index=True— DB enforces uniqueness but route should return clean 409note_linksusesnote.idFKs — slug renames are safe for the relational graphtests/test_crud.pypal-e-docs MCP repo (
forgejo_admin/pal-e-docs-mcp):update_notetool insrc/pal_e_docs_mcp/tools/notes.py(line 79-110) — addnew_slugparameter mapping toslugin API bodyGotcha: Notes referencing other notes by slug in
html_contentwon't auto-update. That's a separate search-and-replace pass, out of scope here.Checklist
slug: str | None = NonetoNoteUpdateinschemas.pyroutes/notes.py— check uniqueness, return 409 on conflictnew_slugparameter to MCPupdate_notetool in pal-e-docs-mcp repoRelated
project-pal-e-docs— the project this affectsplan-2026-02-25-agent-profiles— Phase 3.5 prerequisitesop-index— will use this feature to rename all SOP slugs