mrapprovalsettings

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mrapprovalsettings implements MCP tools for GitLab project merge request approval settings.

The package wraps the GitLab Merge request approvals API:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionSpecs

func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec

ActionSpecs returns canonical specs for merge request approval settings actions.

func FormatOutputMarkdown

func FormatOutputMarkdown(out Output, scope string) string

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

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                `` /* 130-byte string literal not displayed */
	AllowCommitterApproval                      *bool                `` /* 129-byte string literal not displayed */
	AllowOverridesToApproverListPerMergeRequest *bool                `` /* 133-byte string literal not displayed */
	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_to_approver_list_per_merge_request"`
	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                `` /* 130-byte string literal not displayed */
	AllowCommitterApproval                      *bool                `` /* 129-byte string literal not displayed */
	AllowOverridesToApproverListPerMergeRequest *bool                `` /* 133-byte string literal not displayed */
	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                `` /* 143-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