mrapprovalsettings

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mrapprovalsettings implements MCP tool handlers for GitLab merge request approval settings at project and group level. It wraps the MergeRequestApprovalSettings API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output, scope string) string

FormatOutputMarkdown renders MR approval settings as a Markdown table. scope should be "Group" or "Project".

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers all MR approval settings tools on the given MCP server.

Types

type GroupGetInput

type GroupGetInput struct {
	GroupID toolutil.StringOrInt `json:"group_id" jsonschema:"Group ID or URL-encoded path,required"`
}

GroupGetInput defines parameters for retrieving group-level MR approval settings.

type GroupUpdateInput

type GroupUpdateInput struct {
	GroupID                                     toolutil.StringOrInt `json:"group_id"                                        jsonschema:"Group ID or URL-encoded path,required"`
	AllowAuthorApproval                         *bool                `json:"allow_author_approval,omitempty"                  jsonschema:"Allow merge request authors to approve their own MRs"`
	AllowCommitterApproval                      *bool                `json:"allow_committer_approval,omitempty"               jsonschema:"Allow committers to approve MRs they contributed to"`
	AllowOverridesToApproverListPerMergeRequest *bool                `json:"allow_overrides_approver_list_per_mr,omitempty"    jsonschema:"Allow overriding approver list per merge request"`
	RetainApprovalsOnPush                       *bool                `json:"retain_approvals_on_push,omitempty"               jsonschema:"Retain approvals when new commits are pushed"`
	RequireReauthenticationToApprove            *bool                `json:"require_reauthentication_to_approve,omitempty"    jsonschema:"Require password re-entry to approve"`
}

GroupUpdateInput defines parameters for updating group-level MR approval settings.

type Output

type Output struct {
	toolutil.HintableOutput
	AllowAuthorApproval                         SettingOutput `json:"allow_author_approval"`
	AllowCommitterApproval                      SettingOutput `json:"allow_committer_approval"`
	AllowOverridesToApproverListPerMergeRequest SettingOutput `json:"allow_overrides_approver_list_per_mr"`
	RetainApprovalsOnPush                       SettingOutput `json:"retain_approvals_on_push"`
	SelectiveCodeOwnerRemovals                  SettingOutput `json:"selective_code_owner_removals"`
	RequirePasswordToApprove                    SettingOutput `json:"require_password_to_approve"`
	RequireReauthenticationToApprove            SettingOutput `json:"require_reauthentication_to_approve"`
}

Output represents the full set of MR approval settings for a group or project.

func GetGroupSettings

func GetGroupSettings(ctx context.Context, client *gitlabclient.Client, input GroupGetInput) (Output, error)

GetGroupSettings retrieves the MR approval settings for a group.

func GetProjectSettings

func GetProjectSettings(ctx context.Context, client *gitlabclient.Client, input ProjectGetInput) (Output, error)

GetProjectSettings retrieves the MR approval settings for a project.

func UpdateGroupSettings

func UpdateGroupSettings(ctx context.Context, client *gitlabclient.Client, input GroupUpdateInput) (Output, error)

UpdateGroupSettings updates the MR approval settings for a group.

func UpdateProjectSettings

func UpdateProjectSettings(ctx context.Context, client *gitlabclient.Client, input ProjectUpdateInput) (Output, error)

UpdateProjectSettings updates the MR approval settings for a project.

type ProjectGetInput

type ProjectGetInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}

ProjectGetInput defines parameters for retrieving project-level MR approval settings.

type ProjectUpdateInput

type ProjectUpdateInput struct {
	ProjectID                                   toolutil.StringOrInt `json:"project_id"                                      jsonschema:"Project ID or URL-encoded path,required"`
	AllowAuthorApproval                         *bool                `json:"allow_author_approval,omitempty"                  jsonschema:"Allow merge request authors to approve their own MRs"`
	AllowCommitterApproval                      *bool                `json:"allow_committer_approval,omitempty"               jsonschema:"Allow committers to approve MRs they contributed to"`
	AllowOverridesToApproverListPerMergeRequest *bool                `json:"allow_overrides_approver_list_per_mr,omitempty"    jsonschema:"Allow overriding approver list per merge request"`
	RetainApprovalsOnPush                       *bool                `json:"retain_approvals_on_push,omitempty"               jsonschema:"Retain approvals when new commits are pushed"`
	RequireReauthenticationToApprove            *bool                `json:"require_reauthentication_to_approve,omitempty"    jsonschema:"Require password re-entry to approve"`
	SelectiveCodeOwnerRemovals                  *bool                `` /* 134-byte string literal not displayed */
}

ProjectUpdateInput defines parameters for updating project-level MR approval settings.

type SettingOutput

type SettingOutput struct {
	Value         bool   `json:"value"`
	Locked        bool   `json:"locked"`
	InheritedFrom string `json:"inherited_from,omitempty"`
}

SettingOutput represents a single approval setting with its value, lock status, and inheritance source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL