Documentation ¶
Index ¶
- func FindModifiedFiles(files []string, patterns ...string) []string
- func Ptr[T any](v T) *T
- type Actor
- type Client
- type CreateLabelOptions
- type EvalContext
- type EvalContextualizer
- type EvaluationActionResult
- type EvaluationActionStep
- type EvaluationResult
- type Label
- type LabelClient
- type LabelOptions
- type ListLabelsOptions
- type ListMergeRequest
- type ListMergeRequestsOptions
- type ListOptions
- type MergeRequestClient
- type Response
- type UpdateLabelOptions
- type UpdateMergeRequestOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindModifiedFiles ¶ added in v0.8.0
Partially lifted from https://github.com/hmarr/codeowners/blob/main/match.go
Types ¶
type Client ¶
type Client interface { Labels() LabelClient MergeRequests() MergeRequestClient EvalContext(ctx context.Context) (EvalContext, error) ApplyStep(ctx context.Context, evalContext EvalContext, update *UpdateMergeRequestOptions, step EvaluationActionStep) error Start(ctx context.Context) error Stop(ctx context.Context, err error) error }
type CreateLabelOptions ¶
type CreateLabelOptions struct { Name *string `json:"name,omitempty" url:"name,omitempty"` Color *string `json:"color,omitempty" url:"color,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` Priority types.Value[int] `json:"priority" url:"priority,omitempty"` }
CreateLabelOptions represents the available CreateLabel() options.
GitLab API docs: https://docs.gitlab.com/ee/api/labels.html#create-a-new-label
type EvalContext ¶
type EvalContextualizer ¶
type EvalContextualizer struct{}
type EvaluationActionResult ¶ added in v0.3.0
type EvaluationActionResult struct { Name string `yaml:"name"` If string `yaml:"if"` Then []EvaluationActionStep `yaml:"then"` }
type EvaluationActionStep ¶ added in v0.3.0
type EvaluationResult ¶
type EvaluationResult struct { // Name of the label being generated. // // May only be used with [conditional] labelling type Name string // Description for the label being generated. // // Optional; will be an empty string if omitted Description string // The HEX color code to use for the label. // // May use the color variables (e.g., $purple-300) defined in Twitter Bootstrap // https://getbootstrap.com/docs/5.3/customize/color/#all-colors Color string // Priority controls wether the label should be a priority label or regular one. // // This controls if the label is prioritized (sorted first) in the list. Priority types.Value[int] // Wether the evaluation rule matched positive (add label) or negative (remove label) Matched bool }
type Label ¶
type Label struct { ID int `json:"id"` Name string `json:"name"` Color string `json:"color"` TextColor string `json:"text_color"` Description string `json:"description"` OpenIssuesCount int `json:"open_issues_count"` ClosedIssuesCount int `json:"closed_issues_count"` OpenMergeRequestsCount int `json:"open_merge_requests_count"` Subscribed bool `json:"subscribed"` Priority types.Value[int] `json:"priority"` IsProjectLabel bool `json:"is_project_label"` }
Label represents a GitLab label.
GitLab API docs: https://docs.gitlab.com/ee/api/labels.html
type LabelClient ¶
type LabelOptions ¶
type LabelOptions []string
LabelOptions is a custom type with specific marshaling characteristics.
type ListLabelsOptions ¶
type ListLabelsOptions struct { ListOptions WithCounts *bool `json:"with_counts,omitempty" url:"with_counts,omitempty"` IncludeAncestorGroups *bool `json:"include_ancestor_groups,omitempty" url:"include_ancestor_groups,omitempty"` Search *string `json:"search,omitempty" url:"search,omitempty"` }
ListLabelsOptions represents the available ListLabels() options.
GitLab API docs: https://docs.gitlab.com/ee/api/labels.html#list-labels
type ListMergeRequest ¶ added in v0.3.0
type ListMergeRequestsOptions ¶ added in v0.3.0
type ListMergeRequestsOptions struct { ListOptions State string First int }
type ListOptions ¶
type ListOptions struct { // For offset-based paginated result sets, page of results to retrieve. Page int `json:"page,omitempty" url:"page,omitempty"` // For offset-based and keyset-based paginated result sets, the number of results to include per page. PerPage int `json:"per_page,omitempty" url:"per_page,omitempty"` // For keyset-based paginated result sets, name of the column by which to order OrderBy string `json:"order_by,omitempty" url:"order_by,omitempty"` // For keyset-based paginated result sets, the value must be `"keyset"` Pagination string `json:"pagination,omitempty" url:"pagination,omitempty"` // For keyset-based paginated result sets, sort order (`"asc"“ or `"desc"`) Sort string `json:"sort,omitempty" url:"sort,omitempty"` }
ListOptions specifies the optional parameters to various List methods that support pagination.
type MergeRequestClient ¶
type Response ¶
type Response struct { *http.Response // Fields used for offset-based pagination. // TotalItems int // TotalPages int // ItemsPerPage int // CurrentPage int NextPage int }
Response is a GitLab API response. This wraps the standard http.Response returned from GitLab and provides convenient access to things like pagination links.
type UpdateLabelOptions ¶
type UpdateLabelOptions struct { Name *string `json:"name,omitempty" url:"name,omitempty"` NewName *string `json:"new_name,omitempty" url:"new_name,omitempty"` Color *string `json:"color,omitempty" url:"color,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` Priority types.Value[int] `json:"priority" url:"priority,omitempty"` }
type UpdateMergeRequestOptions ¶
type UpdateMergeRequestOptions struct { Title *string `json:"title,omitempty" url:"title,omitempty"` Description *string `json:"description,omitempty" url:"description,omitempty"` TargetBranch *string `json:"target_branch,omitempty" url:"target_branch,omitempty"` AssigneeID *int `json:"assignee_id,omitempty" url:"assignee_id,omitempty"` AssigneeIDs *[]int `json:"assignee_ids,omitempty" url:"assignee_ids,omitempty"` ReviewerIDs *[]int `json:"reviewer_ids,omitempty" url:"reviewer_ids,omitempty"` Labels *LabelOptions `json:"labels,omitempty" url:"labels,comma,omitempty"` AddLabels *LabelOptions `json:"add_labels,omitempty" url:"add_labels,comma,omitempty"` RemoveLabels *LabelOptions `json:"remove_labels,omitempty" url:"remove_labels,comma,omitempty"` MilestoneID *int `json:"milestone_id,omitempty" url:"milestone_id,omitempty"` StateEvent *string `json:"state_event,omitempty" url:"state_event,omitempty"` RemoveSourceBranch *bool `json:"remove_source_branch,omitempty" url:"remove_source_branch,omitempty"` Squash *bool `json:"squash,omitempty" url:"squash,omitempty"` DiscussionLocked *bool `json:"discussion_locked,omitempty" url:"discussion_locked,omitempty"` AllowCollaboration *bool `json:"allow_collaboration,omitempty" url:"allow_collaboration,omitempty"` }
UpdateMergeRequestOptions represents the available UpdateMergeRequest() options.
GitLab API docs: https://docs.gitlab.com/ee/api/merge_requests.html#update-mr