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

resourcegroups

package
v3.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package resourcegroups implements MCP tools for GitLab CI/CD resource group operations.

The package wraps the GitLab Resource groups 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 resource group actions.

func FormatGroupMarkdown

func FormatGroupMarkdown(g ResourceGroupItem) string

FormatGroupMarkdown renders one resource group as the card of a single object.

func FormatJobsMarkdown

func FormatJobsMarkdown(out ListUpcomingJobsOutput) string

FormatJobsMarkdown renders the jobs waiting on a resource group as a Markdown table.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a project's resource groups as a Markdown table.

The two next steps are named separately: reading one group and changing its process mode are different actions, and one hint offering both named a tool that only reads.

Types

type EditInput

type EditInput struct {
	ProjectID   toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Key         string               `json:"key" jsonschema:"Resource group key,required"`
	ProcessMode string               `json:"process_mode" jsonschema:"Process mode: unordered, oldest_first, newest_first, or newest_ready_first,required"`
}

EditInput defines parameters for the edit operation.

type GetInput

type GetInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Key       string               `json:"key" jsonschema:"Resource group key,required"`
}

GetInput defines parameters for the get operation.

type JobItem

type JobItem struct {
	ID           int64            `json:"id"`
	Name         string           `json:"name"`
	Status       string           `json:"status"`
	Stage        string           `json:"stage"`
	Ref          string           `json:"ref,omitempty"`
	Tag          bool             `json:"tag,omitempty"`
	AllowFailure bool             `json:"allow_failure,omitempty"`
	Pipeline     *JobPipelineItem `json:"pipeline,omitempty"`
	WebURL       string           `json:"web_url,omitempty"`
	CreatedAt    string           `json:"created_at,omitempty"`
}

JobItem is one job waiting on a resource group, as a compact row: what the job is, where it comes from and whether its failure would block the pipeline. GitLab answers the queue with Ci::JobBasic, whose other keys are job.get's: the commit, the project and the user, and the fields of a run (its start and finish, duration, coverage and failure reason), which a job that has not run yet leaves empty.

type JobPipelineItem added in v3.1.0

type JobPipelineItem struct {
	ID        int64  `json:"id"`
	IID       int64  `json:"iid,omitempty"`
	ProjectID int64  `json:"project_id"`
	Ref       string `json:"ref"`
	SHA       string `json:"sha"`
	Status    string `json:"status"`
	Source    string `json:"source,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
	WebURL    string `json:"web_url,omitempty"`
}

JobPipelineItem is the pipeline a waiting job belongs to, as the job renders it (Entities::Ci::PipelineBasic): the pipeline's ID, number and project, the ref and commit it runs for, its status and what started it, when it was created and last changed, and its page. The first five are what client-go's JobPipeline models; the rest are read from the captured response (see [upcomingJobExtra]).

type ListInput

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

ListInput defines parameters for the list operation, and the page of the project's resource groups to list. client-go's GetAllResourceGroupsForAProject takes no options struct, so the page travels as a request option.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Groups     []ResourceGroupItem       `json:"groups"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListOutput represents one page of a project's resource groups and the pagination GitLab sent with it.

func ListAll

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

ListAll lists one page of a project's resource groups.

type ListUpcomingJobsInput

type ListUpcomingJobsInput struct {
	ProjectID toolutil.StringOrInt `json:"project_id" jsonschema:"Project ID or URL-encoded path,required"`
	Key       string               `json:"key" jsonschema:"Resource group key,required"`
	toolutil.PaginationInput
}

ListUpcomingJobsInput defines parameters for the list upcoming jobs operation, and the page of those jobs to list. client-go's ListUpcomingJobsForASpecificResourceGroup takes no options struct, so the page travels as a request option.

type ListUpcomingJobsOutput

type ListUpcomingJobsOutput struct {
	toolutil.HintableOutput
	Jobs       []JobItem                 `json:"jobs"`
	Pagination toolutil.PaginationOutput `json:"pagination"`
}

ListUpcomingJobsOutput represents one page of the jobs waiting on a resource group and the pagination GitLab sent with it.

func ListUpcomingJobs

func ListUpcomingJobs(ctx context.Context, client *gitlabclient.Client, input ListUpcomingJobsInput) (ListUpcomingJobsOutput, error)

ListUpcomingJobs lists one page of the jobs waiting on a resource group.

type ResourceGroupItem

type ResourceGroupItem struct {
	toolutil.HintableOutput
	ID          int64  `json:"id"`
	Key         string `json:"key"`
	ProcessMode string `json:"process_mode"`
	CreatedAt   string `json:"created_at,omitempty"`
	UpdatedAt   string `json:"updated_at,omitempty"`
}

ResourceGroupItem is a CI resource group as GitLab renders it (Entities::Ci::ResourceGroup): its key, the process mode that serializes the jobs sharing it, and when it was created and last changed.

func Edit

func Edit(ctx context.Context, client *gitlabclient.Client, input EditInput) (ResourceGroupItem, error)

Edit edits resources for the resourcegroups package.

func Get

Get retrieves resources for the resourcegroups package.

Jump to

Keyboard shortcuts

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