Skip to content

Abstract git remote sync to support GitHub, GitLab, Gitea, and other providers #20

@JohnRDOrazio

Description

@JohnRDOrazio

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions