Skip to content

Proposal: make the plugin forge-agnostic (toward a GitLab sibling) #4

Closed as not planned

Description

@solalbaudoincs

Status: the refactor this proposed is now up as PR #5 (no behavior change, forge descriptor + capability flags). The GitLab sibling is tracked in #6. The original proposal, for the record:

I'd like to add GitLab support, as a sibling plugin (herdr-gitlab) rather than a fork, and this issue is to agree on the design before any code. I'm happy to do the work.

What's already there

The architecture is a good part of the way: the source interface (source.go) already isolates where PRs come from — GitHub or the built-in demo (demo.go is a second implementation in ~400 lines) — and the TUI, worktree handling and labels consume it without caring about the forge.

What leaks GitHub outside github.go

  • repos.go — remote matching assumes github.com / GHE hosts
  • worktree.go — refs/pull/N/head for fork PRs, the push-back-to-fork flow
  • labels.go / agents.go — parsing github.com/owner/repo/pull/N URLs out of Claude Code transcripts
  • main.go / auth — gh auth token as the only sign-in path

Proposed design

  1. A forge descriptor next to the source interface: URL patterns for PR links, ref namespaces, known hosts / remote matching, auth method, merge-method vocabulary. The files above read from the descriptor instead of GitHub constants. For GitLab: glab auth token, fork MR heads via refs/merge-requests/N/head, the same transcript-parsing with GitLab URL patterns.
  2. Capability flags on the source, generalizing what the demo already implicitly lacks: the TUI hides a tab or key when a forge can't do it. GitLab covers most of the surface (draft = Draft: title prefix, auto-merge = merge_when_pipeline_succeeds, squash / remove_source_branch, pinned-sha merge). The one real gap: GitLab has no review-requested:@me equivalent — the Review requested tab would be dropped or remapped for that forge.

For the tabs where GitLab's REST API is simpler than GraphQL search (Mine → GET /merge_requests?scope=created_by_me&state=opened), the GitLab source implements them directly.

Why a sibling plugin, not a fork

The plugin family already shares conventions across repos (look.go kept identical between herdr-github / herdr-linear / herdr-recap). A herdr-gitlab built on the same agnostic core would follow that pattern and multiply the plugin family's reach to GitLab users. Concretely: either a small shared module for the forge-agnostic parts, or whatever structure you prefer — this issue is the place to decide that.

Scope

  • No behavior change for GitHub users; the demo keeps working as a third source implementation.
  • No new runtime dependencies.
  • The GitLab implementation itself comes as a follow-up once the shape here is agreed.

PR #5 implements points 1 and 2 with zero GitHub behavior change (byte-identical wording, 165/165 tests including new ones for the descriptor and the capability gating). Happy to adjust whatever you'd rather see structured differently.

Activity

  1. solalbaudoincs commented on Oct 30, 2026

    @solalbaudoincs
    Author

    Closing — wrong order of operations on our side, will redo properly.

  2. changed the title [-]Proposal: make the plugin forge-agnostic (toward a GitLab sibling)[/-] [+]Withdrawn proposal[/+] on Oct 30, 2026
  3. changed the title [-]Withdrawn proposal[/-] [+]Proposal: make the plugin forge-agnostic (toward a GitLab sibling)[/+] on Oct 30, 2026
  4. mrolafsson commented on Nov 4, 2026

    @mrolafsson
    Owner

    Closing as you mentioned. #5 and #6 carry this on. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions