externalstatuschecks

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package externalstatuschecks implements MCP tool handlers for GitLab external status check operations. It wraps the ExternalStatusChecks service from client-go v2, covering both deprecated and current endpoints.

markdown.go provides Markdown formatting functions for external status check MCP tool output.

register.go wires external status check MCP tools to the MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteProjectExternalStatusCheck

func DeleteProjectExternalStatusCheck(ctx context.Context, client *gitlabclient.Client, input DeleteProjectInput) error

DeleteProjectExternalStatusCheck deletes an external status check from a project.

func FormatListMergeMarkdown

func FormatListMergeMarkdown(out ListMergeStatusCheckOutput) string

FormatListMergeMarkdown renders a list of merge status checks as a Markdown table.

func FormatListProjectMarkdown

func FormatListProjectMarkdown(out ListProjectStatusCheckOutput) string

FormatListProjectMarkdown renders a list of project status checks as a Markdown table.

func FormatMergeCheckMarkdown

func FormatMergeCheckMarkdown(out MergeStatusCheckOutput) string

FormatMergeCheckMarkdown renders a single merge status check as Markdown.

func FormatProjectCheckMarkdown

func FormatProjectCheckMarkdown(out ProjectStatusCheckOutput) string

FormatProjectCheckMarkdown renders a single project status check as Markdown.

func RegisterTools

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

RegisterTools registers all external status check tools on the given MCP server.

func RetryFailedExternalStatusCheckForProjectMR

func RetryFailedExternalStatusCheckForProjectMR(ctx context.Context, client *gitlabclient.Client, input RetryProjectInput) error

RetryFailedExternalStatusCheckForProjectMR retries a failed external status check for a project merge request.

func SetProjectMRExternalStatusCheckStatus

func SetProjectMRExternalStatusCheckStatus(ctx context.Context, client *gitlabclient.Client, input SetProjectStatusInput) error

SetProjectMRExternalStatusCheckStatus sets the status of an external status check for a project merge request.

Types

type CreateProjectInput

type CreateProjectInput struct {
	ProjectID          toolutil.StringOrInt `json:"project_id"            jsonschema:"Project ID or URL-encoded path,required"`
	Name               string               `json:"name"                  jsonschema:"Name of the external status check,required"`
	ExternalURL        string               `json:"external_url"          jsonschema:"External URL for the status check,required"`
	SharedSecret       string               `json:"shared_secret,omitempty" jsonschema:"Shared secret for HMAC verification"`
	ProtectedBranchIDs []int64              `json:"protected_branch_ids,omitempty" jsonschema:"IDs of protected branches to scope the check to"`
}

CreateProjectInput defines parameters for the CreateProjectExternalStatusCheck action.

type DeleteProjectInput

type DeleteProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CheckID   int64                `json:"check_id"   jsonschema:"External status check ID to delete,required"`
}

DeleteProjectInput defines parameters for the DeleteProjectExternalStatusCheck action.

type ListMergeStatusCheckOutput

type ListMergeStatusCheckOutput struct {
	toolutil.HintableOutput
	Items      []MergeStatusCheckOutput  `json:"items"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListMergeStatusCheckOutput is the paginated result of listing merge request external status checks.

func ListProjectMRExternalStatusChecks

func ListProjectMRExternalStatusChecks(ctx context.Context, client *gitlabclient.Client, input ListProjectMRInput) (ListMergeStatusCheckOutput, error)

ListProjectMRExternalStatusChecks lists external status checks for a project merge request.

type ListProjectInput

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

ListProjectInput defines parameters for the ListProjectExternalStatusChecks action.

type ListProjectMRInput

type ListProjectMRInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID     int64                `json:"merge_request_iid"     jsonschema:"Merge request internal ID,required"`
	toolutil.PaginationInput
}

ListProjectMRInput defines parameters for the ListProjectMRExternalStatusChecks action.

type ListProjectStatusCheckOutput

type ListProjectStatusCheckOutput struct {
	toolutil.HintableOutput
	Items      []ProjectStatusCheckOutput `json:"items"`
	Pagination toolutil.PaginationOutput  `json:"pagination"`
}

ListProjectStatusCheckOutput is the paginated result of listing project external status checks.

func ListProjectExternalStatusChecks

func ListProjectExternalStatusChecks(ctx context.Context, client *gitlabclient.Client, input ListProjectInput) (ListProjectStatusCheckOutput, error)

ListProjectExternalStatusChecks lists external status checks for a project.

func ListProjectStatusChecks

ListProjectStatusChecks lists project-level external status checks.

type ListProjectStatusChecksInput

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

ListProjectStatusChecksInput defines parameters for the ListProjectStatusChecks action.

type MergeStatusCheckOutput

type MergeStatusCheckOutput struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	ExternalURL string `json:"external_url"`
	Status      string `json:"status"`
}

MergeStatusCheckOutput represents a single external status check attached to a merge request.

type ProjectStatusCheckOutput

type ProjectStatusCheckOutput struct {
	toolutil.HintableOutput
	ID                int64                   `json:"id"`
	Name              string                  `json:"name"`
	ProjectID         int64                   `json:"project_id"`
	ExternalURL       string                  `json:"external_url"`
	HMAC              bool                    `json:"hmac"`
	ProtectedBranches []ProtectedBranchOutput `json:"protected_branches,omitempty"`
}

ProjectStatusCheckOutput represents a project-level external status check including its HMAC and protected branch scope.

func CreateProjectExternalStatusCheck

func CreateProjectExternalStatusCheck(ctx context.Context, client *gitlabclient.Client, input CreateProjectInput) (ProjectStatusCheckOutput, error)

CreateProjectExternalStatusCheck creates an external status check for a project.

func UpdateProjectExternalStatusCheck

func UpdateProjectExternalStatusCheck(ctx context.Context, client *gitlabclient.Client, input UpdateProjectInput) (ProjectStatusCheckOutput, error)

UpdateProjectExternalStatusCheck updates an external status check for a project.

type ProtectedBranchOutput

type ProtectedBranchOutput struct {
	ID                        int64  `json:"id"`
	ProjectID                 int64  `json:"project_id"`
	Name                      string `json:"name"`
	CodeOwnerApprovalRequired bool   `json:"code_owner_approval_required"`
}

ProtectedBranchOutput represents a protected branch entry associated with a project external status check.

type RetryProjectInput

type RetryProjectInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	MRIID     int64                `json:"merge_request_iid"     jsonschema:"Merge request internal ID,required"`
	CheckID   int64                `json:"check_id"   jsonschema:"External status check ID to retry,required"`
}

RetryProjectInput defines parameters for the RetryFailedExternalStatusCheckForProjectMR action.

type SetProjectStatusInput

type SetProjectStatusInput struct {
	ProjectID             toolutil.StringOrInt `json:"project_id"                jsonschema:"Project ID or URL-encoded path,required"`
	MRIID                 int64                `json:"merge_request_iid"                    jsonschema:"Merge request internal ID,required"`
	SHA                   string               `json:"sha"                       jsonschema:"Head SHA of the merge request source branch,required"`
	ExternalStatusCheckID int64                `json:"external_status_check_id"  jsonschema:"External status check ID to update,required"`
	Status                string               `json:"status"                    jsonschema:"Status value (e.g. passed, failed),required"`
}

SetProjectStatusInput defines parameters for the SetProjectMRExternalStatusCheckStatus action.

type UpdateProjectInput

type UpdateProjectInput struct {
	ProjectID          toolutil.StringOrInt `json:"project_id"            jsonschema:"Project ID or URL-encoded path,required"`
	CheckID            int64                `json:"check_id"              jsonschema:"External status check ID to update,required"`
	Name               string               `json:"name,omitempty"        jsonschema:"Updated name"`
	ExternalURL        string               `json:"external_url,omitempty" jsonschema:"Updated external URL"`
	SharedSecret       string               `json:"shared_secret,omitempty" jsonschema:"Updated shared secret for HMAC verification"`
	ProtectedBranchIDs []int64              `json:"protected_branch_ids,omitempty" jsonschema:"Updated protected branch IDs"`
}

UpdateProjectInput defines parameters for the UpdateProjectExternalStatusCheck action.

Jump to

Keyboard shortcuts

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