Open
Conversation
added 8 commits
March 4, 2026 08:55
Adds a new GitLab adapter that synchronizes repository files from self-hosted GitLab instances into OpenWebUI knowledge bases. The adapter follows the same pattern as the existing GitHub adapter: - Per-repository knowledge base mappings - Recursive file tree fetching via GitLab API v4 - Text file filtering (reuses existing isTextFile helper) - SHA256-based change detection - Pagination support for large repositories - Deterministic iteration order via ordered repository slice Authentication uses Personal Access Tokens. The base URL is configurable for self-hosted instances via config file or the GITLAB_BASE_URL and GITLAB_TOKEN environment variables. Uses github.com/xanzy/go-gitlab v0.115.0.
- Add optional path field to RepositoryMapping to restrict syncing to a subfolder within a repository (e.g. docs/) - Refactor GitLabAdapter to store per-repo path alongside knowledge ID - Pass path to ListTree API call when configured - Fix ContentLength mismatch on upload retries: bytes.Buffer is consumed after the first Do() call; capture body bytes once and create a fresh bytes.NewReader per retry attempt
- Add namespace.yaml for dedicated content-sync namespace - Add namespace: content-sync to all k8s resources - Add GITLAB_TOKEN env var from gitlab-secrets in deployment - Update configmap with GitLab adapter configuration - Fix invalid base64 placeholders in secrets.yaml - Change storageClassName to local-path for local development
The function was calling /api/v1/knowledge/ (list endpoint) and trying
to unmarshal the response as []*Knowledge, causing a JSON decode error
when the API returns a single object. This resulted in an empty file
index on startup, leading to duplicate content errors on re-upload.
Fix: call /api/v1/knowledge/{id} and decode as a single Knowledge object.
…mats The /api/v1/knowledge/ endpoint may return either a JSON array or a paginated wrapper object (items/data field). Try array decode first, fall back to wrapper struct to handle both API versions.
Extend file filter with isGitLabSupportedFile() which adds .pdf to the existing text file whitelist. The GitLab API returns file content as base64-encoded bytes, making binary files like PDFs safe to transfer. OpenWebUI handles PDF text extraction automatically on upload.
…ageClass Replace environment-specific values with generic placeholders suitable for upstream use. Restore storageClassName to ebs-sc (AWS EKS default).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan