Feat/gitea connector#12
Open
loryanstrant wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds first-class Gitea support and improves CLI/client robustness when a KB returns files: null, along with corresponding docs/version updates.
Changes:
- Introduce a new
GiteaConnector(including wildcardgitea:owner/*) and CLI source resolution support. - Fix
fileshandling in CLI status and client to treatnullas an empty list. - Add/adjust tests and documentation; bump version to
0.3.8.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/oikb/connectors/gitea.py |
Adds Gitea connector implementation (tree manifest + raw downloads + wildcard repo listing). |
src/oikb/cli.py |
Routes gitea: sources to the new connector; improves --branch help text; handles files: null in status. |
src/oikb/client.py |
Treats files: null as [] when listing KB files. |
tests/test_gitea_connector.py |
Adds unit tests covering parsing, manifest building (path + pagination), wildcard behavior, and raw reads. |
tests/test_cli_status.py |
Adds regression test for status when files is null. |
docs/guide.md |
Documents Gitea usage and updates connector count/list. |
README.md |
Updates connector count/list and adds Gitea examples. |
CHANGELOG.md |
Documents new Gitea features for 0.3.7/0.3.8. |
src/oikb/__init__.py |
Bumps library version to 0.3.8. |
pyproject.toml |
Bumps project version to 0.3.8. |
.gitignore |
Ignores .env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+81
to
+84
| resp = self._http.get( | ||
| f"/repos/{self.owner}/{repo}/git/trees/{ref}", | ||
| params={"recursive": "true", "per_page": 100, "page": page}, | ||
| ) |
Comment on lines
+79
to
+85
| connector = GiteaConnector( | ||
| owner="owner", | ||
| repo="repo", | ||
| branch="main", | ||
| path="docs", | ||
| base_url="https://gitea.example.com", | ||
| ) |
| while True: | ||
| resp = self._http.get( | ||
| f"/repos/{self.owner}/{repo}/git/trees/{ref}", | ||
| params={"recursive": "true", "per_page": 100, "page": page}, |
| page = 1 | ||
|
|
||
| while True: | ||
| resp = self._http.get(f"/orgs/{self.owner}/repos", params={"page": page, "limit": 50}) |
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.
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:
GiteaConnectorinsrc/oikb/connectors/gitea.pyto 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.src/oikb/cli.py) to dispatchgitea: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:
README.mdanddocs/guide.mdto 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:
filesfields that may beNonein API responses, ensuring that file lists default to empty lists to prevent errors in status reporting and file listing. [1] [2]Testing:
filesfields gracefully.Changelog and Versioning:
CHANGELOG.mdfor versions 0.3.7 and 0.3.8 to document the addition of the Gitea connector and wildcard syncing.pyproject.tomlandsrc/oikb/__init__.pyto 0.3.8. [1] [2]