fix(wiki): gitea_wiki get answers OK and can never return page content #4
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#4
Loading…
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?
Symptom
gitea_wiki get { pageName: "Home" }→OK. No title, no URL, no content. The page exists (the bootcamp page is real; its wiki-repo clone containsHome.md).Root cause — two layers
API: Forgejo's
GET /repos/{owner}/{repo}/wiki/page/{pageName}returns metadata only:There is no body. Wiki content lives in the separate
.wiki.gitrepo; probing/wiki/raw/Home,/wiki/Home?action=rawand/raw/wiki/Homeall 404 for this private repo.Formatter:
lib/handlers/formatters.jshas no wiki branch, and{title, html_url, sub_url}matches none of the fallbacks (login,path,number, array), so it falls through to the defaultOK(see #5).Fix
title,html_url,sub_url, last-commit summary. That alone removes the "OK".ssh://…/<repo>.wiki.gitandgit showthe page, or call the API's git endpoints against it. If that is too heavy for a tool call, change the description to "wiki page metadata" and document that content requires cloning the wiki repo (the DSH bootcamp currently documents exactly that workaround).Acceptance
getreturns at least title + URL (neverOK).Fixed in
30ce29d(PR #14).Note the symptom had drifted: the bare
OKwas already removed by4d77e9f(#5). The remaining defect was two-layer: no wiki formatter, andslimRecordstrippedsub_url/last_commitbefore the formatter ran. Both are fixed;getnow renders title, slug, URL, last-commit summary, and states plainly that the body requires cloning<owner>/<repo>.wiki.git.Live check through the running plugin (
pvlb-infra/vps-setup, pageHome):