[PR #12] Feat/gitea connector #82

Open
opened 2026-10-18 21:14:14 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/12
Author: @loryanstrant
Created: 6/2/2026
Status: 🔄 Open

Base: main ← Head: feat/gitea-connector


📝 Commits (3)

  • 6420dc6 feat: add Gitea source connector
  • 4c66712 fix: handle KB responses with null files
  • f8c5657 feat: support Gitea owner wildcard sources

📊 Changes

11 files changed (+468 additions, -11 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 CHANGELOG.md (+12 -0)
📝 README.md (+5 -3)
📝 docs/guide.md (+38 -2)
📝 pyproject.toml (+1 -1)
📝 src/oikb/__init__.py (+1 -1)
📝 src/oikb/cli.py (+8 -3)
📝 src/oikb/client.py (+1 -1)
➕ src/oikb/connectors/gitea.py (+217 -0)
➕ tests/test_cli_status.py (+31 -0)
➕ tests/test_gitea_connector.py (+153 -0)

📄 Description

This pull request introduces a new Gitea source connector to sync repositories from self-hosted Gitea instances into Open WebUI Knowledge Bases. The Gitea connector supports both single-repo and wildcard (all repos for an owner/org) syncing, with branch and subdirectory scoping, and uses Gitea's API for efficient incremental syncs. The documentation, CLI, and test suite have been updated accordingly. Additionally, minor robustness improvements were made to handle empty file lists in API responses.

Gitea Connector Integration:

  • Added a new GiteaConnector in src/oikb/connectors/gitea.py to support syncing from Gitea repositories, including wildcard owner/org sources (gitea:owner/*) that sync all repositories under an owner, with files prefixed by repository name to avoid path collisions. Supports branch and subdirectory scoping, and uses the Gitea API for incremental sync checksums and file downloads.
  • Updated the CLI (src/oikb/cli.py) to dispatch gitea: sources to the new connector, and clarified branch option help text to refer to "Git repository sources" instead of just GitHub. [1] [2] [3]

Documentation Updates:

  • Updated README.md and docs/guide.md to document the new Gitea connector, example usage, and increased the connector count to 45. Gitea is now listed in all relevant tables and usage examples, including support for wildcard syncing and required environment variables. [1] [2] [3] [4] [5] [6]

Robustness and Bugfixes:

  • Improved handling of files fields that may be None in API responses, ensuring that file lists default to empty lists to prevent errors in status reporting and file listing. [1] [2]

Testing:

  • Added comprehensive tests for the Gitea connector, including parsing, manifest building, wildcard repo handling, and file reading, as well as CLI integration tests.
  • Added a test to ensure the CLI status command handles null files fields gracefully.

Changelog and Versioning:

  • Updated CHANGELOG.md for versions 0.3.7 and 0.3.8 to document the addition of the Gitea connector and wildcard syncing.
  • Bumped version numbers in pyproject.toml and src/oikb/__init__.py to 0.3.8. [1] [2]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/12 **Author:** [@loryanstrant](https://github.com/loryanstrant) **Created:** 6/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/gitea-connector` --- ### 📝 Commits (3) - [`6420dc6`](https://github.com/open-webui/oikb/commit/6420dc6995707aefe2ad94076c6b4b817874b719) feat: add Gitea source connector - [`4c66712`](https://github.com/open-webui/oikb/commit/4c667123dcf1a26daff70eef286bb5d0a2e7654b) fix: handle KB responses with null files - [`f8c5657`](https://github.com/open-webui/oikb/commit/f8c565710ce39ed870a6a4a3081f817ef4da7286) feat: support Gitea owner wildcard sources ### 📊 Changes **11 files changed** (+468 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `CHANGELOG.md` (+12 -0) 📝 `README.md` (+5 -3) 📝 `docs/guide.md` (+38 -2) 📝 `pyproject.toml` (+1 -1) 📝 `src/oikb/__init__.py` (+1 -1) 📝 `src/oikb/cli.py` (+8 -3) 📝 `src/oikb/client.py` (+1 -1) ➕ `src/oikb/connectors/gitea.py` (+217 -0) ➕ `tests/test_cli_status.py` (+31 -0) ➕ `tests/test_gitea_connector.py` (+153 -0) </details> ### 📄 Description This pull request introduces a new Gitea source connector to sync repositories from self-hosted Gitea instances into Open WebUI Knowledge Bases. The Gitea connector supports both single-repo and wildcard (all repos for an owner/org) syncing, with branch and subdirectory scoping, and uses Gitea's API for efficient incremental syncs. The documentation, CLI, and test suite have been updated accordingly. Additionally, minor robustness improvements were made to handle empty file lists in API responses. **Gitea Connector Integration:** * Added a new `GiteaConnector` in `src/oikb/connectors/gitea.py` to support syncing from Gitea repositories, including wildcard owner/org sources (`gitea:owner/*`) that sync all repositories under an owner, with files prefixed by repository name to avoid path collisions. Supports branch and subdirectory scoping, and uses the Gitea API for incremental sync checksums and file downloads. * Updated the CLI (`src/oikb/cli.py`) to dispatch `gitea:` sources to the new connector, and clarified branch option help text to refer to "Git repository sources" instead of just GitHub. [[1]](diffhunk://#diff-0dc7516586245c7db1c8104a5ca133e053fc6a8d6288eb5b660d844ed64ca941R53-R57) [[2]](diffhunk://#diff-0dc7516586245c7db1c8104a5ca133e053fc6a8d6288eb5b660d844ed64ca941L352-R357) [[3]](diffhunk://#diff-0dc7516586245c7db1c8104a5ca133e053fc6a8d6288eb5b660d844ed64ca941L509-R514) **Documentation Updates:** * Updated `README.md` and `docs/guide.md` to document the new Gitea connector, example usage, and increased the connector count to 45. Gitea is now listed in all relevant tables and usage examples, including support for wildcard syncing and required environment variables. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L3-R3) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L137-R141) [[3]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R153-R154) [[4]](diffhunk://#diff-07fdd026b11c494c3b62c97f764f6939803c453389ebefd6b05e6f187d44859aR21) [[5]](diffhunk://#diff-07fdd026b11c494c3b62c97f764f6939803c453389ebefd6b05e6f187d44859aR236-R270) [[6]](diffhunk://#diff-07fdd026b11c494c3b62c97f764f6939803c453389ebefd6b05e6f187d44859aL319-R359) **Robustness and Bugfixes:** * Improved handling of `files` fields that may be `None` in API responses, ensuring that file lists default to empty lists to prevent errors in status reporting and file listing. [[1]](diffhunk://#diff-0dc7516586245c7db1c8104a5ca133e053fc6a8d6288eb5b660d844ed64ca941L716-R721) [[2]](diffhunk://#diff-96fa515156d1dcc9f334c734bfdf73405f564979901fa65434a90017ebecc325L138-R138) **Testing:** * Added comprehensive tests for the Gitea connector, including parsing, manifest building, wildcard repo handling, and file reading, as well as CLI integration tests. * Added a test to ensure the CLI status command handles null `files` fields gracefully. **Changelog and Versioning:** * Updated `CHANGELOG.md` for versions 0.3.7 and 0.3.8 to document the addition of the Gitea connector and wildcard syncing. * Bumped version numbers in `pyproject.toml` and `src/oikb/__init__.py` to 0.3.8. [[1]](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711L3-R3) [[2]](diffhunk://#diff-4edb420453ca7ec2c1e682b6e87afbf1ed891478147ea851bf1d7cbced573a31L3-R3) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#82
No description provided.