Documentation
¶
Overview ¶
Package epicissues implements MCP tools for GitLab epic issue relation operations.
The package wraps the GitLab Epic issues API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatAssignMarkdown(out AssignOutput) string
- func FormatListMarkdown(out ListOutput) string
- func FormatRemoveMarkdown(out RemoveOutput) string
- type AssignInput
- type AssignOutput
- type ChildOutput
- type ListInput
- type ListOutput
- type RemoveInput
- type RemoveOutput
- type UpdateInput
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 epic issue hierarchy actions.
func FormatAssignMarkdown ¶
func FormatAssignMarkdown(out AssignOutput) string
FormatAssignMarkdown renders an epic-issue assignment as the card of the link it made: the two global ids the mutation echoed, which are what every later call on this pair takes.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders the issues of one epic as a Markdown table: a collection of objects that share columns.
The ID column carries the GraphQL global id, which is what the reorder action takes; the reference is linked to the issue, which is what the preserve-links hint is for and what the table used to promise without carrying a single link. The full reference names the project the child lives in, which is what the assign and remove actions take as child_project_path; a row GitLab sent without one falls back to #iid.
func FormatRemoveMarkdown ¶ added in v3.3.0
func FormatRemoveMarkdown(out RemoveOutput) string
FormatRemoveMarkdown renders an epic-issue removal as the card of the link it removed: the epic the issue was checked to belong to and the issue now outside it. Its next steps are the epic's list and assigning the issue back, since removing it again has nothing left to remove.
Types ¶
type AssignInput ¶
type AssignInput struct {
FullPath string `json:"full_path" jsonschema:"Full path of the group that contains the epic,required"`
IID int64 `json:"epic_iid" jsonschema:"Epic IID within the group,required"`
ChildProjectPath string `json:"child_project_path" jsonschema:"Full project path of the issue to assign (e.g. my-group/my-project),required"`
ChildIID int64 `json:"child_iid" jsonschema:"IID of the issue to assign to the epic,required"`
}
AssignInput defines parameters for assigning an issue to an epic.
type AssignOutput ¶
type AssignOutput struct {
toolutil.HintableOutput
EpicGID string `json:"epic_gid"`
ChildGID string `json:"child_gid"`
}
AssignOutput represents the result of assigning an issue to an epic.
func Assign ¶
func Assign(ctx context.Context, client *gitlabclient.Client, input AssignInput) (AssignOutput, error)
Assign links an existing issue to an epic via the Work Items GraphQL hierarchy widget.
type ChildOutput ¶
type ChildOutput struct {
ID string `json:"id"`
IID int64 `json:"iid"`
Reference string `json:"reference,omitempty"`
Type string `json:"type,omitempty"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
State string `json:"state"`
Confidential bool `json:"confidential,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Archived bool `json:"archived,omitempty"`
Imported bool `json:"imported,omitempty"`
ExternalAuthor string `json:"external_author,omitempty"`
UserDiscussionsCount int64 `json:"user_discussions_count"`
WebURL string `json:"web_url,omitempty"`
Author string `json:"author,omitempty"`
Labels []string `json:"labels,omitempty"`
LabelDetails []*toolutil.LabelDetailsOutput `json:"label_details,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
ClosedAt string `json:"closed_at,omitempty"`
MovedToWorkItemURL string `json:"moved_to_work_item_url,omitempty"`
DuplicatedToWorkItemURL string `json:"duplicated_to_work_item_url,omitempty"`
PromotedToEpicURL string `json:"promoted_to_epic_url,omitempty"`
}
ChildOutput represents a child work item (issue) within an epic.
reference is the child's full reference (group/project#iid for an issue), which names the project child_project_path takes without the caller parsing web_url. type is the work item type's name, since the hierarchy lists tasks and child epics beside issues. labels keeps the names every issue output carries and label_details the rest of each label, as the epic output does. The three URL keys say where the item went when it was moved, closed as a duplicate or promoted to an epic, and are absent otherwise.
type ListInput ¶
type ListInput struct {
FullPath string `json:"full_path" jsonschema:"Full path of the group (e.g. my-group or my-group/sub-group),required"`
IID int64 `json:"epic_iid" jsonschema:"Epic IID within the group,required"`
toolutil.GraphQLCursorPaginationInput
}
ListInput defines parameters for listing child issues of an epic.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Issues []ChildOutput `json:"issues"`
Pagination toolutil.GraphQLPaginationOutput `json:"pagination"`
}
ListOutput holds a paginated list of child issues in an epic.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List retrieves child issues of an epic via the Work Items GraphQL hierarchy widget.
func UpdateOrder ¶
func UpdateOrder(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (ListOutput, error)
UpdateOrder reorders an issue within an epic by moving it relative to another issue.
type RemoveInput ¶
type RemoveInput struct {
FullPath string `json:"full_path" jsonschema:"Full path of the group that contains the epic,required"`
IID int64 `json:"epic_iid" jsonschema:"Epic IID within the group,required"`
ChildProjectPath string `json:"child_project_path" jsonschema:"Full project path of the issue to remove,required"`
ChildIID int64 `json:"child_iid" jsonschema:"IID of the issue to remove from the epic,required"`
}
RemoveInput defines parameters for removing an issue from an epic.
type RemoveOutput ¶ added in v3.3.0
type RemoveOutput struct {
toolutil.HintableOutput
EpicGID string `json:"epic_gid"`
ChildGID string `json:"child_gid"`
}
RemoveOutput represents the result of removing an issue from an epic: the epic it was checked to be a child of, and the issue now in none. It is a type of its own so its card says the link was removed; the removal used to answer with the assignment's type, and every removal read "Epic Issue assigned".
func Remove ¶
func Remove(ctx context.Context, client *gitlabclient.Client, input RemoveInput) (RemoveOutput, error)
Remove unlinks an issue from an epic by clearing the child's parent reference, once the child is known to sit under the epic named.
type UpdateInput ¶
type UpdateInput struct {
FullPath string `json:"full_path" jsonschema:"Full path of the group that contains the epic,required"`
IID int64 `json:"epic_iid" jsonschema:"Epic IID within the group,required"`
ChildID string `json:"child_id" jsonschema:"Work item GID of the issue to reorder (from list output id field),required"`
AdjacentID string `json:"adjacent_id,omitempty" jsonschema:"Work item GID of the reference issue to position relative to"`
RelativePosition string `json:"relative_position,omitempty" jsonschema:"Position relative to adjacent item: BEFORE or AFTER"`
}
UpdateInput defines parameters for reordering an issue within an epic.