Documentation
¶
Overview ¶
Package releases implements MCP tools for GitLab release operations.
The package wraps the GitLab Releases API:
Index ¶
- func ActionSpecs(client *gitlabclient.Client) []toolutil.ActionSpec
- func FormatListMarkdown(out ListOutput) string
- func FormatMarkdown(r Output) string
- type AssetLinkInput
- type AssetsInput
- type CreateInput
- type DeleteInput
- type GetInput
- type GetLatestInput
- type ListInput
- type ListOutput
- type Output
- func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (Output, error)
- func Get(ctx context.Context, client *gitlabclient.Client, input GetInput) (Output, error)
- func GetLatest(ctx context.Context, client *gitlabclient.Client, input GetLatestInput) (Output, error)
- func ToOutput(r *gl.Release) Output
- func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
- 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 release actions.
func FormatListMarkdown ¶
func FormatListMarkdown(out ListOutput) string
FormatListMarkdown renders a list of releases as a Markdown table.
func FormatMarkdown ¶
FormatMarkdown renders a single release as a Markdown summary.
Types ¶
type AssetLinkInput ¶ added in v2.3.0
type AssetLinkInput struct {
Name string `json:"name,omitempty" jsonschema:"Name of the asset link as shown in the release"`
URL string `json:"url,omitempty" jsonschema:"URL of the asset"`
FilePath string `json:"filepath,omitempty" jsonschema:"Deprecated relative path; prefer direct_asset_path"`
DirectAssetPath string `json:"direct_asset_path,omitempty" jsonschema:"Relative path to direct asset link (e.g. /binaries/app.zip)"`
LinkType string `json:"link_type,omitempty" jsonschema:"Asset link type: other (default), runbook, image, or package"`
}
AssetLinkInput mirrors gl.ReleaseAssetLinkOptions: a single release asset link supplied at creation time.
type AssetsInput ¶ added in v2.3.0
type AssetsInput struct {
Links []AssetLinkInput `json:"links,omitempty" jsonschema:"Asset links to attach to the release"`
}
AssetsInput mirrors gl.ReleaseAssetsOptions: the assets attached when creating a release.
type CreateInput ¶
type CreateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
TagName string `json:"tag_name" jsonschema:"Tag name associated with the release,required"`
Name string `json:"name,omitempty" jsonschema:"Release title"`
Description string `json:"description,omitempty" jsonschema:"Release notes (Markdown supported)"`
ReleasedAt string `json:"released_at,omitempty" jsonschema:"Date of the release in ISO 8601 format"`
Ref string `` /* 158-byte string literal not displayed */
Milestones []string `json:"milestones,omitempty" jsonschema:"Milestone titles to associate with the release"`
TagMessage string `json:"tag_message,omitempty" jsonschema:"Message to use for the annotated tag (creates annotated tag instead of lightweight)"`
Assets *AssetsInput `json:"assets,omitempty" jsonschema:"Asset links to attach to the release at creation time"`
}
CreateInput defines parameters for creating a GitLab release.
type DeleteInput ¶
type DeleteInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
TagName string `json:"tag_name" jsonschema:"Tag name of the release to delete,required"`
}
DeleteInput defines parameters for deleting a release.
type GetInput ¶
type GetInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
TagName string `json:"tag_name" jsonschema:"Tag name of the release,required"`
}
GetInput defines parameters for getting a release.
type GetLatestInput ¶
type GetLatestInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
}
GetLatestInput defines parameters for retrieving the latest release.
type ListInput ¶
type ListInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
OrderBy string `json:"order_by,omitempty" jsonschema:"Order by field (released_at, created_at)"`
Sort string `json:"sort,omitempty" jsonschema:"Sort direction (asc, desc)"`
IncludeHTMLDescription bool `` /* 128-byte string literal not displayed */
toolutil.PaginationInput
toolutil.KeysetPaginationInput
}
ListInput defines parameters for listing releases.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Releases []Output `json:"releases"`
Pagination toolutil.PaginationOutput `json:"pagination"`
}
ListOutput holds a list of releases.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, input ListInput) (ListOutput, error)
List returns a paginated list of releases for a GitLab project. Results can be ordered by released_at or created_at and sorted ascending or descending.
type Output ¶
type Output struct {
toolutil.HintableOutput
TagName string `json:"tag_name"`
Name string `json:"name"`
Description string `json:"description"`
DescriptionHTML string `json:"description_html,omitempty"`
CreatedAt string `json:"created_at"`
ReleasedAt string `json:"released_at"`
Author *toolutil.AuthorOutput `json:"author,omitempty"`
Commit *toolutil.CommitOutput `json:"commit,omitempty"`
UpcomingRelease bool `json:"upcoming_release,omitempty"`
Milestones []*toolutil.MilestoneOutput `json:"milestones,omitempty"`
CommitPath string `json:"commit_path,omitempty"`
TagPath string `json:"tag_path,omitempty"`
Assets *toolutil.AssetsOutput `json:"assets,omitempty"`
Evidences []*toolutil.EvidenceOutput `json:"evidences,omitempty"`
Links *toolutil.LinksOutput `json:"_links,omitempty"`
}
Output represents a GitLab release. Nested sub-objects (author, commit, assets, _links, milestones, evidences) mirror the corresponding client-go types field-for-field per the 1:1 audit policy. See shapes.go.
func Create ¶
func Create(ctx context.Context, client *gitlabclient.Client, input CreateInput) (Output, error)
Create creates a new release in a GitLab project for the specified tag. Returns the created release details or an error if the tag is not found.
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) (Output, error)
Delete removes a release from a GitLab project by tag name. Returns the deleted release details or an error if the release does not exist.
func GetLatest ¶
func GetLatest(ctx context.Context, client *gitlabclient.Client, input GetLatestInput) (Output, error)
GetLatest retrieves the latest release for a GitLab project.
func ToOutput ¶
ToOutput converts a GitLab API gl.Release to the MCP tool output format, formatting timestamps as RFC 3339 strings. Nested objects (author, commit, assets, _links, milestones, evidences) are mirrored via the converters in shapes.go.
func Update ¶
func Update(ctx context.Context, client *gitlabclient.Client, input UpdateInput) (Output, error)
Update modifies an existing release identified by project and tag name. Only non-empty fields in the input are applied as updates.
type UpdateInput ¶
type UpdateInput struct {
ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
TagName string `json:"tag_name" jsonschema:"Tag name of the release,required"`
Name string `json:"name,omitempty" jsonschema:"New release title"`
Description string `json:"description,omitempty" jsonschema:"Updated release notes"`
ReleasedAt string `json:"released_at,omitempty" jsonschema:"New release date in ISO 8601 format"`
Milestones []string `json:"milestones,omitempty" jsonschema:"Milestone titles to associate with the release"`
}
UpdateInput defines parameters for updating a release.