commits

package
v2.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package commits implements MCP tools for GitLab commit operations.

The package wraps the GitLab Commits 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 commit actions exposed as MCP tools. Every read, create, update, and history route is projected into the dynamic, meta, individual, and audit surfaces by the action catalog (ADR-0004).

func FormatCommentMarkdown

func FormatCommentMarkdown(c CommentOutput) string

FormatCommentMarkdown renders a single commit comment.

func FormatCommentsMarkdown

func FormatCommentsMarkdown(out CommentsOutput) string

FormatCommentsMarkdown renders a paginated list of commit comments.

func FormatDetailMarkdown

func FormatDetailMarkdown(c DetailOutput) string

FormatDetailMarkdown renders a single commit detail as a Markdown summary.

func FormatDiffMarkdown

func FormatDiffMarkdown(out DiffOutput) string

FormatDiffMarkdown renders a paginated list of commit diffs as a Markdown table.

func FormatGPGSignatureMarkdown

func FormatGPGSignatureMarkdown(sig GPGSignatureOutput) string

FormatGPGSignatureMarkdown renders a GPG signature as Markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a paginated list of commits as a Markdown table.

func FormatMRsByCommitMarkdown

func FormatMRsByCommitMarkdown(out MRsByCommitOutput) string

FormatMRsByCommitMarkdown renders a list of merge requests for a commit.

func FormatOutputMarkdown

func FormatOutputMarkdown(c Output) string

FormatOutputMarkdown renders a single commit as a Markdown summary.

func FormatRefsMarkdown

func FormatRefsMarkdown(out RefsOutput) string

FormatRefsMarkdown renders a paginated list of commit refs as Markdown.

func FormatStatusMarkdown

func FormatStatusMarkdown(s StatusOutput) string

FormatStatusMarkdown renders a single commit status.

func FormatStatusesMarkdown

func FormatStatusesMarkdown(out StatusesOutput) string

FormatStatusesMarkdown renders a paginated list of commit statuses.

Types

type Action

type Action struct {
	Action          string `json:"action"    jsonschema:"Action to perform on the file (create, update, delete, move, chmod),required"`
	FilePath        string `json:"file_path" jsonschema:"Full path of the file (e.g. src/main.go),required"`
	PreviousPath    string `json:"previous_path,omitempty" jsonschema:"Original path when action is move"`
	Content         string `json:"content,omitempty"    jsonschema:"File content (required for create and update)"`
	Encoding        string `json:"encoding,omitempty"   jsonschema:"Content encoding: 'text' (default) or 'base64'"`
	LastCommitID    string `json:"last_commit_id,omitempty" jsonschema:"Last known commit ID of this file for conflict detection"`
	ExecuteFilemode bool   `json:"execute_filemode,omitempty" jsonschema:"When true, enable or disable the executable flag on the file"`
}

Action specifies a single file operation within a commit. It mirrors gl.CommitActionOptions field-for-field (C-IMPORTS).

type BasicMROutput

type BasicMROutput struct {
	ID           int64  `json:"id"`
	IID          int64  `json:"merge_request_iid"`
	Title        string `json:"title"`
	State        string `json:"state"`
	SourceBranch string `json:"source_branch"`
	TargetBranch string `json:"target_branch"`
	WebURL       string `json:"web_url"`
	Author       string `json:"author,omitempty"`
}

BasicMROutput represents a basic merge request associated with a commit.

type BasicUserOutput added in v2.3.0

type BasicUserOutput struct {
	ID        int64  `json:"id,omitempty"`
	Username  string `json:"username,omitempty"`
	Name      string `json:"name,omitempty"`
	Email     string `json:"email,omitempty"`
	State     string `json:"state,omitempty"`
	Blocked   bool   `json:"blocked,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
}

BasicUserOutput mirrors gl.Author, the user object returned on commit comments and commit statuses.

type CherryPickInput

type CherryPickInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA to cherry-pick"`
	Branch    string               `json:"branch"     jsonschema:"Target branch name,required"`
	DryRun    bool                 `json:"dry_run,omitempty"  jsonschema:"If true, does not create the commit but checks for conflicts"`
	Message   string               `json:"message,omitempty"  jsonschema:"Custom commit message (defaults to original)"`
}

CherryPickInput defines parameters for cherry-picking a commit.

type CommentOutput

type CommentOutput struct {
	toolutil.HintableOutput
	Note     string           `json:"note"`
	Path     string           `json:"path,omitempty"`
	Line     int64            `json:"line,omitempty"`
	LineType string           `json:"line_type,omitempty"`
	Author   *BasicUserOutput `json:"author,omitempty"`
}

CommentOutput represents a single commit comment. It mirrors gl.CommitComment (C-IMPORTS), surfacing the author as a full user object.

func PostComment

func PostComment(ctx context.Context, client *gitlabclient.Client, input PostCommentInput) (CommentOutput, error)

PostComment creates a comment on a commit.

type CommentsInput

type CommentsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA,required"`
	OrderBy   string               `json:"order_by,omitempty" jsonschema:"For keyset pagination, the column to order results by"`
	Sort      string               `json:"sort,omitempty"     jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

CommentsInput defines parameters for listing comments on a commit. It mirrors gl.GetCommitCommentsOptions (C-IMPORTS) and supports offset and keyset pagination via order_by/sort/page_token.

type CommentsOutput

type CommentsOutput struct {
	toolutil.HintableOutput
	Comments   []CommentOutput           `json:"comments"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

CommentsOutput holds a paginated list of commit comments.

func GetComments

func GetComments(ctx context.Context, client *gitlabclient.Client, input CommentsInput) (CommentsOutput, error)

GetComments retrieves the comments on a commit.

type CommitStatsOutput added in v2.3.0

type CommitStatsOutput struct {
	Additions int64 `json:"additions"`
	Deletions int64 `json:"deletions"`
	Total     int64 `json:"total"`
}

CommitStatsOutput mirrors gl.CommitStats: line additions/deletions/total for a commit.

type CreateInput

type CreateInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id"      jsonschema:"Project ID or URL-encoded path,required"`
	Branch        string               `json:"branch"          jsonschema:"Target branch name,required"`
	CommitMessage string               `json:"commit_message"  jsonschema:"Commit message,required"`
	StartBranch   string               `json:"start_branch,omitempty" jsonschema:"Branch to start from if target branch does not exist"`
	StartSHA      string               `json:"start_sha,omitempty"    jsonschema:"SHA to start from if target branch does not exist (alternative to start_branch)"`
	StartProject  string               `` /* 137-byte string literal not displayed */
	Actions       []Action             `json:"actions"         jsonschema:"List of file actions (create, update, delete, move, chmod),required"`
	AuthorEmail   string               `json:"author_email,omitempty" jsonschema:"Custom author email"`
	AuthorName    string               `json:"author_name,omitempty"  jsonschema:"Custom author name"`
	Stats         bool                 `json:"stats,omitempty"        jsonschema:"Include commit stats (additions, deletions, total) in the response"`
	Force         bool                 `json:"force,omitempty"        jsonschema:"When true, force-overwrite the target branch even if a conflict exists"`
}

CreateInput defines parameters for creating a commit with file actions. It mirrors gl.CreateCommitOptions (C-IMPORTS).

type DetailOutput

type DetailOutput struct {
	toolutil.HintableOutput
	ID               string              `json:"id"`
	ShortID          string              `json:"short_id"`
	Title            string              `json:"title"`
	Message          string              `json:"message"`
	AuthorName       string              `json:"author_name"`
	AuthorEmail      string              `json:"author_email"`
	AuthoredDate     string              `json:"authored_date,omitempty"`
	CommitterName    string              `json:"committer_name"`
	CommitterEmail   string              `json:"committer_email"`
	CommittedDate    string              `json:"committed_date"`
	CreatedAt        string              `json:"created_at,omitempty"`
	WebURL           string              `json:"web_url"`
	ParentIDs        []string            `json:"parent_ids"`
	Status           string              `json:"status,omitempty"`
	ProjectID        int64               `json:"project_id,omitempty"`
	Trailers         map[string]string   `json:"trailers,omitempty"`
	ExtendedTrailers map[string]string   `json:"extended_trailers,omitempty"`
	LastPipeline     *LastPipelineOutput `json:"last_pipeline,omitempty"`
	Stats            *CommitStatsOutput  `json:"stats,omitempty"`
}

DetailOutput represents a single commit with full details. It mirrors the full gl.Commit payload (C-IMPORTS).

func Get

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

Get retrieves a single commit by SHA from a GitLab project.

type DiffInput

type DiffInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA hash to get diffs for,required"`
	Unidiff   bool                 `json:"unidiff,omitempty" jsonschema:"Return diffs in unified diff format"`
	OrderBy   string               `json:"order_by,omitempty" jsonschema:"For keyset pagination, the column to order results by"`
	Sort      string               `json:"sort,omitempty"     jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

DiffInput defines parameters for retrieving diffs of a commit. It mirrors gl.GetCommitDiffOptions (C-IMPORTS) and supports offset and keyset pagination via order_by/sort/page_token.

type DiffOutput

type DiffOutput struct {
	toolutil.HintableOutput
	Diffs      []toolutil.DiffOutput     `json:"diffs"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

DiffOutput holds the list of file diffs for a commit.

func Diff

func Diff(ctx context.Context, client *gitlabclient.Client, input DiffInput) (DiffOutput, error)

Diff retrieves the file diffs for a specific commit.

type GPGSignatureInput

type GPGSignatureInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA,required"`
}

GPGSignatureInput defines parameters for retrieving a commit's GPG signature.

type GPGSignatureOutput

type GPGSignatureOutput struct {
	toolutil.HintableOutput
	SignatureType      string                 `json:"signature_type,omitempty"`
	VerificationStatus string                 `json:"verification_status"`
	CommitSource       string                 `json:"commit_source,omitempty"`
	KeyID              int64                  `json:"gpg_key_id"`
	KeyPrimaryKeyID    string                 `json:"gpg_key_primary_keyid"`
	KeyUserName        string                 `json:"gpg_key_user_name"`
	KeyUserEmail       string                 `json:"gpg_key_user_email"`
	KeySubkeyID        int64                  `json:"gpg_key_subkey_id,omitempty"`
	Key                *SSHSignatureKey       `json:"key,omitempty"`
	X509Certificate    *X509CertificateOutput `json:"x509_certificate,omitempty"`
}

GPGSignatureOutput represents a commit's cryptographic signature. It mirrors the documented "Get the signature of a commit" response, which is a superset of gl.GPGSignature: the SDK struct only exposes the PGP (gpg_key_*) fields and verification_status, while the documented response also returns signature_type, commit_source, and the SSH (key) and X.509 (x509_certificate) sub-objects. Those documented-but-not-in-SDK fields are surfaced via a raw REST fetch (client.GL().NewRequest+Do, per doc/api/commits.md#get-the-signature-of-a-commit).

func GetGPGSignature

func GetGPGSignature(ctx context.Context, client *gitlabclient.Client, input GPGSignatureInput) (GPGSignatureOutput, error)

GetGPGSignature retrieves the cryptographic signature of a commit. It uses a raw REST fetch to surface the full documented signature superset (PGP, SSH, and X.509 variants); the SDK's gl.GPGSignature only exposes the PGP subset.

type GetInput

type GetInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA hash to retrieve,required"`
	Stats     bool                 `json:"stats,omitempty" jsonschema:"Include commit stats (additions, deletions, total); defaults to true on GitLab"`
}

GetInput defines parameters for retrieving a single commit. It mirrors gl.GetCommitOptions (C-IMPORTS).

type LastPipelineOutput added in v2.3.0

type LastPipelineOutput = toolutil.LastPipelineOutput

LastPipelineOutput mirrors gl.PipelineInfo, the pipeline summary embedded in a commit payload as last_pipeline. Canonical shape shared via toolutil.

type ListInput

type ListInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id"            jsonschema:"Project ID or URL-encoded path,required"`
	RefName     string               `json:"ref_name,omitempty"    jsonschema:"Branch name, tag, or commit SHA to list commits from (default: default branch)"`
	Since       string               `json:"since,omitempty"       jsonschema:"Return commits after this date (ISO 8601 format, e.g. 2025-01-01T00:00:00Z)"`
	Until       string               `json:"until,omitempty"       jsonschema:"Return commits before this date (ISO 8601 format, e.g. 2025-12-31T23:59:59Z)"`
	Path        string               `json:"path,omitempty"        jsonschema:"File path to filter commits by (only commits touching this path)"`
	Author      string               `json:"author,omitempty"      jsonschema:"Filter by commit author name or email"`
	All         bool                 `json:"all,omitempty"         jsonschema:"Retrieve every commit from the whole repository (across all branches)"`
	WithStats   bool                 `json:"with_stats,omitempty"  jsonschema:"Include commit stats (additions, deletions, total)"`
	FirstParent bool                 `json:"first_parent,omitempty" jsonschema:"Follow only the first parent commit upon seeing a merge commit"`
	Trailers    bool                 `json:"trailers,omitempty"    jsonschema:"Parse and include Git trailers for every commit"`
	OrderBy     string               `json:"order_by,omitempty"    jsonschema:"For keyset pagination, the column to order results by"`
	Sort        string               `json:"sort,omitempty"        jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

ListInput defines parameters for listing commits in a GitLab project. It mirrors gl.ListCommitsOptions (C-IMPORTS) and supports offset and keyset pagination via order_by/sort/page_token.

type ListOutput

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

ListOutput holds a paginated list of commits.

func List

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

List retrieves a paginated list of commits for a GitLab project. Supports filtering by branch/tag, date range, file path, and author.

type MRsByCommitInput

type MRsByCommitInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA,required"`
}

MRsByCommitInput defines parameters for listing merge requests associated with a commit.

type MRsByCommitOutput

type MRsByCommitOutput struct {
	toolutil.HintableOutput
	MergeRequests []BasicMROutput `json:"merge_requests"`
}

MRsByCommitOutput holds the list of merge requests for a commit.

func ListMRsByCommit

func ListMRsByCommit(ctx context.Context, client *gitlabclient.Client, input MRsByCommitInput) (MRsByCommitOutput, error)

ListMRsByCommit retrieves merge requests associated with a commit.

type Output

type Output struct {
	toolutil.HintableOutput
	ID               string              `json:"id"`
	ShortID          string              `json:"short_id"`
	Title            string              `json:"title"`
	Message          string              `json:"message,omitempty"`
	AuthorName       string              `json:"author_name"`
	AuthorEmail      string              `json:"author_email"`
	AuthoredDate     string              `json:"authored_date,omitempty"`
	CommitterName    string              `json:"committer_name"`
	CommitterEmail   string              `json:"committer_email"`
	CommittedDate    string              `json:"committed_date"`
	CreatedAt        string              `json:"created_at,omitempty"`
	WebURL           string              `json:"web_url"`
	ParentIDs        []string            `json:"parent_ids,omitempty"`
	Status           string              `json:"status,omitempty"`
	ProjectID        int64               `json:"project_id,omitempty"`
	Trailers         map[string]string   `json:"trailers,omitempty"`
	ExtendedTrailers map[string]string   `json:"extended_trailers,omitempty"`
	LastPipeline     *LastPipelineOutput `json:"last_pipeline,omitempty"`
	Stats            *CommitStatsOutput  `json:"stats,omitempty"`
}

Output represents a created commit. It mirrors the full gl.Commit payload (C-IMPORTS), surfacing trailers, the last associated pipeline, and stats.

func CherryPick

func CherryPick(ctx context.Context, client *gitlabclient.Client, input CherryPickInput) (Output, error)

CherryPick cherry-picks a commit to a target branch.

func Create

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

Create creates a new commit in the specified GitLab project with one or more file actions. Supports optional start branch (to create a new branch from an existing one) and custom author metadata. Returns the created commit details or an error if the API call fails.

func Revert

func Revert(ctx context.Context, client *gitlabclient.Client, input RevertInput) (Output, error)

Revert reverts a commit on a target branch.

func ToOutput

func ToOutput(c *gl.Commit) Output

ToOutput converts a GitLab API gl.Commit to the list/summary MCP tool output format, mirroring the full commit payload.

type PostCommentInput

type PostCommentInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA,required"`
	Note      string               `json:"note"       jsonschema:"Comment text,required"`
	Path      string               `json:"path,omitempty"      jsonschema:"File path to comment on (for inline comments)"`
	Line      int64                `json:"line,omitempty"      jsonschema:"Line number to comment on"`
	LineType  string               `json:"line_type,omitempty" jsonschema:"Line type: new or old (default: new)"`
}

PostCommentInput defines parameters for posting a comment on a commit.

type RefOutput

type RefOutput struct {
	Type string `json:"type"`
	Name string `json:"name"`
}

RefOutput represents a branch or tag referencing a commit.

type RefsInput

type RefsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA to look up,required"`
	Type      string               `json:"type,omitempty" jsonschema:"Filter by ref type: branch, tag, or all (default: all)"`
	OrderBy   string               `json:"order_by,omitempty" jsonschema:"For keyset pagination, the column to order results by"`
	Sort      string               `json:"sort,omitempty"     jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

RefsInput defines parameters for retrieving branches/tags referencing a commit. It mirrors gl.GetCommitRefsOptions (C-IMPORTS) and supports offset and keyset pagination via order_by/sort/page_token.

type RefsOutput

type RefsOutput struct {
	toolutil.HintableOutput
	Refs       []RefOutput               `json:"refs"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

RefsOutput holds a paginated list of refs referencing a commit.

func GetRefs

func GetRefs(ctx context.Context, client *gitlabclient.Client, input RefsInput) (RefsOutput, error)

GetRefs retrieves branches and tags a commit is pushed to.

type RevertInput

type RevertInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	SHA       string               `json:"sha"        jsonschema:"Commit SHA to revert"`
	Branch    string               `json:"branch"     jsonschema:"Target branch name,required"`
}

RevertInput defines parameters for reverting a commit.

type SSHSignatureKey added in v2.3.0

type SSHSignatureKey struct {
	ID        int64  `json:"id"`
	Title     string `json:"title,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	ExpiresAt string `json:"expires_at,omitempty"`
	Key       string `json:"key,omitempty"`
	UsageType string `json:"usage_type,omitempty"`
}

SSHSignatureKey mirrors the documented `key` object on an SSH-signed commit signature (doc/api/commits.md#get-the-signature-of-a-commit). The SDK gl.GPGSignature lacks this object, so it is decoded via the raw REST superset.

type SetStatusInput

type SetStatusInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id"   jsonschema:"Project ID or URL-encoded path,required"`
	SHA         string               `json:"sha"          jsonschema:"Commit SHA,required"`
	State       string               `json:"state"        jsonschema:"Status state: pending, running, success, failed, canceled,required"`
	Ref         string               `json:"ref,omitempty"         jsonschema:"Branch or tag name"`
	Name        string               `json:"name,omitempty"        jsonschema:"Status name / context"`
	Context     string               `json:"context,omitempty"     jsonschema:"Status context label (overrides name)"`
	TargetURL   string               `json:"target_url,omitempty"  jsonschema:"URL to link from the status"`
	Description string               `json:"description,omitempty" jsonschema:"Short description of the status"`
	Coverage    float64              `json:"coverage,omitempty"    jsonschema:"Code coverage percentage"`
	PipelineID  int64                `json:"pipeline_id,omitempty" jsonschema:"Pipeline ID to associate the status with"`
}

SetStatusInput defines parameters for setting a commit pipeline status.

type StatusOutput

type StatusOutput struct {
	toolutil.HintableOutput
	ID           int64            `json:"id"`
	SHA          string           `json:"sha"`
	Ref          string           `json:"ref"`
	Status       string           `json:"status"`
	Name         string           `json:"name"`
	TargetURL    string           `json:"target_url,omitempty"`
	Description  string           `json:"description,omitempty"`
	Coverage     float64          `json:"coverage,omitempty"`
	PipelineID   int64            `json:"pipeline_id,omitempty"`
	AllowFailure bool             `json:"allow_failure,omitempty"`
	CreatedAt    string           `json:"created_at,omitempty"`
	StartedAt    string           `json:"started_at,omitempty"`
	FinishedAt   string           `json:"finished_at,omitempty"`
	Author       *BasicUserOutput `json:"author,omitempty"`
}

StatusOutput represents a single commit pipeline status. It mirrors gl.CommitStatus (C-IMPORTS), surfacing the author as a full user object.

func SetStatus

func SetStatus(ctx context.Context, client *gitlabclient.Client, input SetStatusInput) (StatusOutput, error)

SetStatus sets the pipeline status of a commit.

type StatusesInput

type StatusesInput struct {
	ProjectID  toolutil.StringOrInt `json:"project_id"  jsonschema:"Project ID or URL-encoded path,required"`
	SHA        string               `json:"sha"         jsonschema:"Commit SHA,required"`
	Ref        string               `json:"ref,omitempty"        jsonschema:"Branch or tag name filter"`
	Stage      string               `json:"stage,omitempty"      jsonschema:"Stage name filter"`
	Name       string               `json:"name,omitempty"       jsonschema:"Status name filter"`
	PipelineID int64                `json:"pipeline_id,omitempty" jsonschema:"Pipeline ID filter"`
	All        bool                 `json:"all,omitempty"        jsonschema:"Return all statuses including retries"`
	OrderBy    string               `json:"order_by,omitempty"   jsonschema:"For keyset pagination, the column to order results by"`
	Sort       string               `json:"sort,omitempty"       jsonschema:"Sort order for keyset pagination: 'asc' or 'desc'"`
	toolutil.PaginationInput
	toolutil.KeysetPaginationInput
}

StatusesInput defines parameters for listing pipeline statuses of a commit. It mirrors gl.GetCommitStatusesOptions (C-IMPORTS) and supports offset and keyset pagination via order_by/sort/page_token.

type StatusesOutput

type StatusesOutput struct {
	toolutil.HintableOutput
	Statuses   []StatusOutput            `json:"statuses"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

StatusesOutput holds a paginated list of commit statuses.

func GetStatuses

func GetStatuses(ctx context.Context, client *gitlabclient.Client, input StatusesInput) (StatusesOutput, error)

GetStatuses retrieves the pipeline statuses of a commit.

type X509CertificateOutput added in v2.3.0

type X509CertificateOutput struct {
	ID                   int64             `json:"id"`
	Subject              string            `json:"subject,omitempty"`
	SubjectKeyIdentifier string            `json:"subject_key_identifier,omitempty"`
	Email                string            `json:"email,omitempty"`
	SerialNumber         json.Number       `json:"serial_number,omitempty"`
	CertificateStatus    string            `json:"certificate_status,omitempty"`
	X509Issuer           *X509IssuerOutput `json:"x509_issuer,omitempty"`
}

X509CertificateOutput mirrors the documented `x509_certificate` object on an X.509-signed commit signature (doc/api/commits.md#get-the-signature-of-a-commit). The SDK gl.GPGSignature lacks this object, so it is decoded via the raw REST superset.

type X509IssuerOutput added in v2.3.0

type X509IssuerOutput struct {
	ID                   int64  `json:"id"`
	Subject              string `json:"subject,omitempty"`
	SubjectKeyIdentifier string `json:"subject_key_identifier,omitempty"`
	CRLURL               string `json:"crl_url,omitempty"`
}

X509IssuerOutput mirrors the documented nested `x509_issuer` object of an X.509 certificate (doc/api/commits.md#get-the-signature-of-a-commit).

Jump to

Keyboard shortcuts

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