Skip to content

Support for multiple forges (not just GitHub) #1240

Description

@ic4-y

Context

Kolu's PR metadata integration is hardcoded to GitHub. The kolu-github package shells out to gh pr view, which only resolves PRs on repositories whose remotes point to a known GitHub host. When a terminal's repo is hosted on any other forge (Forgejo, GitLab, Gitea, SourceHut, etc.), gh pr view fails with:

none of the git remotes configured for this repository point to a known GitHub host.

This is classified as not-authenticated and logged as WARN on every 30s poll cycle — noisy and misleading for users who simply aren't on GitHub.

Current Architecture

  • packages/integrations/github/gh-CLI-based PR resolution, tightly coupled to GitHub's API surface
  • packages/server/src/terminalBackend/providers.ts:startGitHubPrProvider — wires the GitHub watcher into the terminal metadata pipeline
  • Remote forge detection does not exist — the provider is always github-pr regardless of the actual remote URL

Proposed Direction

Introduce a forge abstraction so kolu can resolve PR metadata across multiple forges:

  1. Forge detection — parse the remote URL's host to identify the forge type (GitHub, GitLab, Forgejo/Gitea, etc.). Fall back to absent when the remote is not a recognized forge, and suppress PR-related logging in that case.

  2. Provider interface — define a common PrProvider interface (resolve PR by repo+branch, return number/title/url/state/checks) that each forge adapter implements. The existing kolu-github package becomes the GitHub adapter.

  3. DispatchsubscribeGitHubPr (or its successor) picks the right adapter based on the detected forge, or emits absent when no adapter matches.

  4. Forgejo/Gitea — these expose a GitHub-compatible API surface, so the existing gh-based approach may work with --host configuration, or a lightweight adapter using the Forgejo API directly.

  5. GitLab — requires a separate adapter using the GitLab REST/GraphQL API.

Motivation

Self-hosted forges (Forgejo, Gitea, GitLab) are common in the Nix/NixOS ecosystem. Kolu's user base skews technical and many will not be on GitHub. PR metadata is a visible part of the terminal dock (the PR pill), and losing it entirely on non-GitHub repos degrades the experience.

Scope

This is a feature request, not a bug report. The immediate log noise could be papered over by reclassifying the "no GitHub remote" error as absent, but the right fix is forge abstraction. Happy to help with implementation or testing against a Forgejo instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions