Skip to content

feat(gitlab): add project wiki support to the GitLab connector#77

Open
MeEfe wants to merge 1 commit into
open-webui:mainfrom
MeEfe:feature/gitlab-connector-wiki-support
Open

feat(gitlab): add project wiki support to the GitLab connector#77
MeEfe wants to merge 1 commit into
open-webui:mainfrom
MeEfe:feature/gitlab-connector-wiki-support

Conversation

@MeEfe

@MeEfe MeEfe commented Jul 13, 2026

Copy link
Copy Markdown

Add GitLab wiki connector

Closes #47.

GitLab stores project wikis separately from the repository, so this adds wiki
support to the existing GitLab connector. Add ?wiki=true to a gitlab: source
to sync a project's wiki instead of its code — each wiki page becomes a file in
the KB, preserving the page hierarchy from its slug.

Usage

oikb sync "gitlab:owner/repo?wiki=true" --kb-id <kb>
oikb sync "gitlab:group/subgroup/project?wiki=true" --kb-id <kb>   # subgroups
oikb sync "gitlab:42?wiki=true" --kb-id <kb>                        # numeric project ID

Uses the Project Wikis API (GET /projects/:id/wikis), reuses GITLAB_TOKEN /
GITLAB_URL, and adds no new dependency (httpx is already core).

What's included

  • ?wiki=true flag - routes the GitLab connector to the wiki endpoint. Repo mode is byte-for-byte unchanged.
  • Numeric project IDs - gitlab:42 / gitlab:42?wiki=true, used directly as the API :id. Handy when the namespace path is deep or awkward to encode.
  • Subgroup paths - gitlab:group/subgroup/project?wiki=true, URL-encoding the full nested namespace.
  • Older-GitLab fallback - uses with_content=1 on the list endpoint when available, and falls back to GET /wikis/:slug per page on instances that don't return content inline.

Design note

I extended the existing GitLab connector with a ?wiki=true source flag rather
than adding a separate connector, following the query-string option convention
already used by the Jira connector (jira:KEY?jql=...). This keeps the change
contained to gitlab.py and its source parser and leaves the repository code
path untouched. Happy to split it into a dedicated gitlab_wiki: connector
instead if you'd prefer.

Testing

Tested end-to-end against a self-hosted GitLab instance:

  • Synced a 44-page wiki via the path form (gitlab:org/repo?wiki=true) and the numeric ID (gitlab:42?wiki=true).
  • Through all three trigger paths: direct CLI (oikb sync <source>), the .oikb.yaml config file, and the daemon API (built a Docker image from this branch and ran it as the daemon).
  • Verified the manifest (filename/path/checksum/size), nested wiki slugs (e.g. Administrative/Local-information.md → path Administrative), and that the request hits /projects/:id/wikis?with_content=1.

Verified with mocked (respx) requests during development: subgroup path encoding
(group%2Fsubgroup%2Fproject), the numeric-repo form, the older-GitLab per-page
fallback, and that repo mode is unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Gitlab wiki connector

1 participant