Help us shape the future of Go! Take the 2026 Go Developer Survey

commitdiscussions

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package commitdiscussions implements MCP tools for GitLab commit discussion operations.

The package wraps the GitLab Discussions API for commit threads:

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 commit discussion actions.

func DeleteNote

func DeleteNote(ctx context.Context, client *gitlabclient.Client, input DeleteNoteInput) error

DeleteNote deletes a commit discussion note.

func DeleteNoteOutput

func DeleteNoteOutput(ctx context.Context, client *gitlabclient.Client, input DeleteNoteInput) (toolutil.DeleteOutput, error)

DeleteNoteOutput deletes a commit discussion note and returns the canonical success message shape.

func FormatListMarkdownString

func FormatListMarkdownString(out ListOutput) string

FormatListMarkdownString renders discussions list as Markdown.

func FormatMarkdownString

func FormatMarkdownString(out Output) string

FormatMarkdownString renders a discussion as Markdown.

func FormatNoteMarkdownString

func FormatNoteMarkdownString(out NoteOutput) string

FormatNoteMarkdownString renders a note as Markdown.

Types

type AddNoteInput

type AddNoteInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA    string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	DiscussionID string               `json:"discussion_id" jsonschema:"Discussion ID to reply to,required"`
	Body         string               `json:"body" jsonschema:"Note body (Markdown supported),required"`
}

AddNoteInput defines parameters for adding a note to a commit discussion.

type CreateInput

type CreateInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	Body      string               `json:"body" jsonschema:"Discussion body (Markdown supported),required"`
	Position  *PositionInput       `json:"position,omitempty" jsonschema:"Position for inline diff comments"`
}

CreateInput defines parameters for creating a commit discussion.

type DeleteNoteInput

type DeleteNoteInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA    string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	DiscussionID string               `json:"discussion_id" jsonschema:"Discussion ID,required"`
	NoteID       int64                `json:"note_id" jsonschema:"Note ID to delete,required"`
}

DeleteNoteInput defines parameters for deleting a commit discussion note.

type GetInput

type GetInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA    string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	DiscussionID string               `json:"discussion_id" jsonschema:"Discussion ID,required"`
}

GetInput defines parameters for getting a single commit discussion.

type ListInput

type ListInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	Page      int64                `json:"page,omitempty" jsonschema:"Page number for pagination"`
	PerPage   int64                `json:"per_page,omitempty" jsonschema:"Number of items per page"`
}

ListInput defines parameters for listing commit discussions.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Discussions []Output                  `json:"discussions"`
	Pagination  toolutil.PaginationOutput `json:"pagination"`
}

ListOutput holds a list of commit discussions.

func List

func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)

List lists commit discussions.

type NoteOutput

type NoteOutput = toolutil.DiscussionNoteOutput

NoteOutput represents a single note within a discussion.

func AddNote

func AddNote(ctx context.Context, client *gitlabclient.Client, input AddNoteInput) (NoteOutput, error)

AddNote adds a note to an existing commit discussion.

func UpdateNote

func UpdateNote(ctx context.Context, client *gitlabclient.Client, input UpdateNoteInput) (NoteOutput, error)

UpdateNote updates an existing commit discussion note.

type Output

type Output = toolutil.DiscussionOutput

Output represents a discussion thread.

func Create

func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)

Create creates a new commit discussion thread.

func Get

func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)

Get gets a single commit discussion.

type PositionInput

type PositionInput struct {
	BaseSHA      string `json:"base_sha" jsonschema:"Base commit SHA,required"`
	StartSHA     string `json:"start_sha" jsonschema:"Start commit SHA,required"`
	HeadSHA      string `json:"head_sha" jsonschema:"Head commit SHA,required"`
	PositionType string `json:"position_type" jsonschema:"Position type (text or image),required"`
	NewPath      string `json:"new_path,omitempty" jsonschema:"File path after change"`
	NewLine      int64  `json:"new_line,omitempty" jsonschema:"Line number after change"`
	OldPath      string `json:"old_path,omitempty" jsonschema:"File path before change"`
	OldLine      int64  `json:"old_line,omitempty" jsonschema:"Line number before change"`
}

PositionInput defines position attributes for inline commit discussions.

type UpdateNoteInput

type UpdateNoteInput struct {
	ProjectID    toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	CommitSHA    string               `json:"commit_sha" jsonschema:"Commit SHA,required"`
	DiscussionID string               `json:"discussion_id" jsonschema:"Discussion ID,required"`
	NoteID       int64                `json:"note_id" jsonschema:"Note ID to update,required"`
	Body         string               `json:"body" jsonschema:"Updated note body,required"`
}

UpdateNoteInput defines parameters for updating a commit discussion note.

Jump to

Keyboard shortcuts

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