fix: wiki API sub-page support and content response (#606, #607) #608

Merged
jmiller merged 1 commits from fix/606-607-wiki-api-bugs into main 2026-06-11 22:17:02 +00:00
Owner

Summary

Fixes two wiki API bugs:

#606: Sub-pages with path separators return 404

  • Changed wiki API routes from {pageName} to wildcard * to capture slashes in page paths (e.g. mcp/fleet-overview)
  • Changed ListWikiPages to use ListEntriesRecursiveFast() instead of ListEntries() so pages in subdirectories are included
  • Fixed pagination to count only regular files, not directories

#607: content_base64 empty in POST/PATCH responses

  • Added error logging in wikiContentsByEntry to diagnose empty content responses
  • The route fix for #606 may also resolve cases where path mismatches caused content lookup failures

Changes

  • routers/api/v1/api.go: Wiki routes use wildcard instead of {pageName}
  • routers/api/v1/repo/wiki.go: Recursive listing, wildcard path param, error logging

MCP Compatibility

The MCP tool gitea_wiki_page_get already constructs URLs with the page name in the path — slashes will now work naturally with the wildcard route.

Closes #606, Closes #607

## Summary Fixes two wiki API bugs: ### #606: Sub-pages with path separators return 404 - Changed wiki API routes from `{pageName}` to wildcard `*` to capture slashes in page paths (e.g. `mcp/fleet-overview`) - Changed `ListWikiPages` to use `ListEntriesRecursiveFast()` instead of `ListEntries()` so pages in subdirectories are included - Fixed pagination to count only regular files, not directories ### #607: content_base64 empty in POST/PATCH responses - Added error logging in `wikiContentsByEntry` to diagnose empty content responses - The route fix for #606 may also resolve cases where path mismatches caused content lookup failures ## Changes - `routers/api/v1/api.go`: Wiki routes use wildcard instead of `{pageName}` - `routers/api/v1/repo/wiki.go`: Recursive listing, wildcard path param, error logging ## MCP Compatibility The MCP tool `gitea_wiki_page_get` already constructs URLs with the page name in the path — slashes will now work naturally with the wildcard route. Closes #606, Closes #607
jmiller added 1 commit 2026-06-11 21:57:04 +00:00
fix: wiki API sub-page support and content response (#606, #607)
Generic: Project CI / Tests (pull_request) Blocked by required conditions
Universal: PR Check / Build RC Package (pull_request) Blocked by required conditions
Universal: PR Check / Report Issues (pull_request) Blocked by required conditions
Branch Policy Check / Verify merge target (pull_request) Failing after 4s
Generic: Repo Health / Scripts governance (pull_request) Blocked by required conditions
Universal: PR Check / Branch Policy (pull_request) Failing after 4s
Generic: Repo Health / Repository health (pull_request) Blocked by required conditions
Generic: Repo Health / Report Issues (pull_request) Blocked by required conditions
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 4s
Universal: PR Check / Validate PR (pull_request) Failing after 14s
Generic: Repo Health / Scripts governance (push) Blocked by required conditions
Generic: Repo Health / Repository health (push) Blocked by required conditions
Generic: Repo Health / Report Issues (push) Blocked by required conditions
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 3s
Branch Cleanup / Delete merged branch (pull_request) Has been skipped
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Universal: Auto Version Bump / Version Bump (push) Failing after 12s
Generic: Project CI / Lint & Validate (pull_request) Successful in 44s
Universal: Build & Release / Promote to RC (pull_request) Successful in 44s
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Successful in 57s
PR RC Release / Build RC Release (pull_request) Failing after 54s
3a7b07590f
- Change wiki API routes from {pageName} to wildcard (*) to support
  pages with path separators (e.g. mcp/fleet-overview)
- Use ListEntriesRecursiveFast() in ListWikiPages to include pages
  in subdirectories, not just root-level files
- Add error logging in wikiContentsByEntry for diagnosing empty
  content_base64 responses
- Fix pagination to count only regular files, not directories

Co-Authored-By: Moko Consulting <hello@mokoconsulting.tech>
jmiller closed this pull request 2026-06-11 21:57:34 +00:00
jmiller deleted branch fix/606-607-wiki-api-bugs 2026-06-11 21:57:39 +00:00
jmiller reopened this pull request 2026-06-11 22:16:35 +00:00
jmiller merged commit 5893a8b9dd into main 2026-06-11 22:17:02 +00:00
Sign in to join this conversation.