Summary
The current remote sync implementation is GitHub-specific (github_service.py). The git operations via pygit2 are already provider-agnostic, but the API layer for PR sync, webhook handling, and repository operations only supports GitHub.
This should be abstracted into a provider-agnostic interface so that OntoKit can sync with any git-compatible remote: GitHub, GitLab, Gitea, Bitbucket, or any self-hosted git server.
What needs to change
- Define a
RemoteProvider interface with methods for:
- PR lifecycle: create, update, merge, close, reopen, list
- Reviews: create, list
- Comments: create, list
- Webhooks: setup, verify signature, handle events
- Repository info: scan files, get content, get repo metadata
- Refactor
github_service.py into a GitHubProvider implementation of that interface
- Add implementations for at least GitLab and Gitea
- Update
GitHubIntegration model to a more generic RemoteIntegration model with a provider field
- Update webhook handler to route events based on provider type (different payload formats)
- Update
github_sync.py — the git-level push/pull is already provider-agnostic (just needs the remote URL), but any API calls need to go through the provider interface
Context
Raised in discussion on #13. OntoKit should be deployable without any dependency on a specific commercial git hosting service. The sync provider must be interchangeable and optional.
Summary
The current remote sync implementation is GitHub-specific (
github_service.py). The git operations via pygit2 are already provider-agnostic, but the API layer for PR sync, webhook handling, and repository operations only supports GitHub.This should be abstracted into a provider-agnostic interface so that OntoKit can sync with any git-compatible remote: GitHub, GitLab, Gitea, Bitbucket, or any self-hosted git server.
What needs to change
RemoteProviderinterface with methods for:github_service.pyinto aGitHubProviderimplementation of that interfaceGitHubIntegrationmodel to a more genericRemoteIntegrationmodel with aproviderfieldgithub_sync.py— the git-level push/pull is already provider-agnostic (just needs the remote URL), but any API calls need to go through the provider interfaceContext
Raised in discussion on #13. OntoKit should be deployable without any dependency on a specific commercial git hosting service. The sync provider must be interchangeable and optional.