Skip to content

GitLab Merge Request support for code-review plugin #26932

Description

@jangel97

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

The code-review plugin currently supports only GitHub pull requests via the gh CLI and mcp__github_inline_comment__create_inline_comment. I’d like to contribute support for GitLab merge requests.

Many teams use GitLab, both on gitlab.com and self-hosted instances. The plugin’s multi-agent review workflow is largely platform-agnostic in concept; the GitHub-specific logic is mostly limited to:

  • fetching diffs

  • checking MR/PR status

  • posting review comments

Extending this to GitLab would make the plugin usable in a wider range of environments without changing its core design.

Proposed Solution

  • Platform detection
    Detect GitHub vs GitLab based on the git remote, using API probing to correctly handle self-hosted GitLab instances.

  • GitLab CLI integration
    Use glab (GitLab’s official CLI) for MR operations such as:

    • glab mr view
    • glab mr diff
    • glab mr note
  • Inline comments
    Post position-based comments via glab api and the GitLab Discussions API, avoiding the need for a new MCP tool.

  • Single command file
    Keep a single code-review.md command that branches internally based on the detected platform.

  • Link format
    Use GitLab’s URL format for source links:

    /-/blob/<sha>/<path>#L<line>
    

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

No response

Additional Context

  1. Is GitLab MR support something you’d be open to accepting, or do you prefer keeping the plugin GitHub-only?
  2. Would you prefer extending the existing code-review command, or introducing a separate GitLab-specific command?
  3. Are there any concerns about adding glab to the allowed tools alongside gh?

Happy to adjust the approach based on feedback before starting implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions