Documentation
¶
Overview ¶
action_specs.go holds what this package contributes to the canonical action catalog. The specs themselves are declared in internal/tools/adminspecs, which is the one place the gitlab_admin group is assembled; what stays here is the route a spec takes, because setting a feature gate needs an input schema the reflected one cannot express.
This package used to declare a full set of specs of its own that nothing ever aggregated, so they reached no surface and no validation.
Package features implements MCP tools for GitLab instance feature flag toggles.
The package wraps the GitLab Features API:
Index ¶
- func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
- func FormatFeatureMarkdown(output SetOutput) *mcp.CallToolResult
- func FormatListDefinitionsMarkdown(output ListDefinitionsOutput) *mcp.CallToolResult
- func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
- func SetRoute(client *gitlabclient.Client) toolutil.ActionRoute
- type DefinitionItem
- type DeleteInput
- type FeatureItem
- type GateItem
- type ListDefinitionsInput
- type ListDefinitionsOutput
- type ListInput
- type ListOutput
- type SetInput
- type SetOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(ctx context.Context, client *gitlabclient.Client, input DeleteInput) error
Delete removes a feature flag.
func FormatFeatureMarkdown ¶
func FormatFeatureMarkdown(output SetOutput) *mcp.CallToolResult
FormatFeatureMarkdown renders one feature flag as the card of one object, with the definition GitLab ships for it as a nested object.
func FormatListDefinitionsMarkdown ¶
func FormatListDefinitionsMarkdown(output ListDefinitionsOutput) *mcp.CallToolResult
FormatListDefinitionsMarkdown renders the feature definitions GitLab ships as a Markdown table.
func FormatListMarkdown ¶
func FormatListMarkdown(output ListOutput) *mcp.CallToolResult
FormatListMarkdown renders the instance's feature flags as a Markdown table: a collection of objects that share columns.
func SetRoute ¶
func SetRoute(client *gitlabclient.Client) toolutil.ActionRoute
SetRoute returns the meta-tool route for setting instance feature flags.
Types ¶
type DefinitionItem ¶
type DefinitionItem struct {
Name string `json:"name"`
IntroducedByURL string `json:"introduced_by_url,omitempty"`
RolloutIssueURL string `json:"rollout_issue_url,omitempty"`
Milestone string `json:"milestone,omitempty"`
LogStateChanges bool `json:"log_state_changes"`
Type string `json:"type,omitempty"`
Group string `json:"group,omitempty"`
DefaultEnabled bool `json:"default_enabled"`
// FeatureIssueURL and IntendedToRolloutBy are the issue tracking the flag
// and the milestone it is meant to be gone by.
FeatureIssueURL string `json:"feature_issue_url,omitempty"`
IntendedToRolloutBy string `json:"intended_to_rollout_by,omitempty"`
}
DefinitionItem represents a feature definition.
type DeleteInput ¶
type DeleteInput struct {
Name string `json:"name" jsonschema:"Feature flag name to delete,required"`
}
DeleteInput is the input for deleting a feature flag.
type FeatureItem ¶
type FeatureItem struct {
Name string `json:"name"`
State string `json:"state"`
Gates []GateItem `json:"gates,omitempty"`
Definition *DefinitionItem `json:"definition,omitempty"`
}
FeatureItem represents a feature flag.
type ListDefinitionsInput ¶
type ListDefinitionsInput struct{}
ListDefinitionsInput is the input for listing feature definitions.
type ListDefinitionsOutput ¶
type ListDefinitionsOutput struct {
toolutil.HintableOutput
Definitions []DefinitionItem `json:"definitions"`
}
ListDefinitionsOutput is the output for listing feature definitions.
func ListDefinitions ¶
func ListDefinitions(ctx context.Context, client *gitlabclient.Client, _ ListDefinitionsInput) (ListDefinitionsOutput, error)
ListDefinitions retrieves all feature definitions.
type ListOutput ¶
type ListOutput struct {
toolutil.HintableOutput
Features []FeatureItem `json:"features"`
}
ListOutput is the output for listing features.
func List ¶
func List(ctx context.Context, client *gitlabclient.Client, _ ListInput) (ListOutput, error)
List retrieves all feature flags.
type SetInput ¶
type SetInput struct {
Name string `json:"name" jsonschema:"Feature flag name,required"`
Value any `json:"value" jsonschema:"Value to set (true, false, integer percentage, or string),required"`
Key string `json:"key,omitempty" jsonschema:"Gate key (percentage_of_actors or percentage_of_time)"`
FeatureGroup string `json:"feature_group,omitempty" jsonschema:"Feature group name"`
User string `json:"user,omitempty" jsonschema:"GitLab username"`
Group string `json:"group,omitempty" jsonschema:"GitLab group path"`
Namespace string `json:"namespace,omitempty" jsonschema:"GitLab namespace path"`
Project string `` /* 166-byte string literal not displayed */
Repository string `json:"repository,omitempty" jsonschema:"GitLab repository path"`
Force bool `json:"force,omitempty" jsonschema:"Force the change even if the flag is read-only"`
}
SetInput is the input for setting a feature flag.
type SetOutput ¶
type SetOutput struct {
toolutil.HintableOutput
Feature FeatureItem `json:"feature"`
}
SetOutput is the output for setting a feature flag.
func Set ¶
Set creates or updates a feature flag. Uses a raw HTTP request to work around upstream client-go issue where SetFeatureFlagOptions fields lack omitempty, causing GitLab to reject the request with "mutually exclusive" errors for empty string fields. Tracked, unreported so far, in docs/development/upstream-bugs.md.