Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConditionalLabel labelType = "conditional" GenerateLabels labelType = "generate" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶ added in v0.3.0
type Action scm.EvaluationActionResult
type Config ¶
type Config struct {
// (Optional) When on, no actions will be taken, but instead logged for review
DryRun *bool `json:"dry_run,omitempty" yaml:"dry_run" jsonschema:"default=false"`
// (Optional) Import configuration from other git repositories
//
// See: https://jippi.github.io/scm-engine/configuration/#include
Includes []Include `json:"include,omitempty" yaml:"include"`
// (Optional) Configure what users that should be ignored when considering activity on a Merge Request
//
// SCM-Engine defines activity as comments, reviews, commits, adding/removing labels and similar actions made on a change request.
//
// See: https://jippi.github.io/scm-engine/configuration/#ignore_activity_from
IgnoreActivityFrom IgnoreActivityFrom `json:"ignore_activity_from,omitempty" yaml:"ignore_activity_from"`
// (Optional) Actions can modify a Merge Request in various ways, for example, adding a comment or closing the Merge Request.
//
// See: https://jippi.github.io/scm-engine/configuration/#actions
Actions Actions `json:"actions,omitempty" yaml:"actions"`
// (Optional) Labels are a way to categorize and filter issues, merge requests, and epics in GitLab. -- GitLab documentation
//
// See: https://jippi.github.io/scm-engine/configuration/#label
Labels Labels `json:"label,omitempty" yaml:"label"`
}
func FromContext ¶ added in v0.10.1
func ParseFileString ¶ added in v0.16.0
ParseFile parses a Gitlabber file, returning a Config.
type IgnoreActivityFrom ¶ added in v0.10.1
type IgnoreActivityFrom struct {
// (Optional) Should bot users be ignored when considering activity? Default: false
//
// See: https://jippi.github.io/scm-engine/configuration/#ignore_activity_from.bots
IsBot bool `json:"bots,omitempty" yaml:"bots" jsonschema:"default=false"`
// (Optional) A list of usernames that should be ignored when considering user activity. Default: []
//
// See: https://jippi.github.io/scm-engine/configuration/#ignore_activity_from.usernames
Usernames []string `json:"usernames,omitempty" yaml:"usernames"`
// (Optional) A list of emails that should be ignored when considering user activity. Default: []
// NOTE: If a user do not have a public email configured on their profile, that users activity will never match this rule.
//
// See: https://jippi.github.io/scm-engine/configuration/#ignore_activity_from.emails
Emails []string `json:"emails,omitempty" yaml:"emails"`
}
type Include ¶ added in v0.16.0
type Include struct {
// The project to include files from
//
// See: https://jippi.github.io/scm-engine/configuration/#include.project
Project string `json:"project" yaml:"project"`
// The list of files to include from the project. The paths must be relative to the repository root, e.x. label/some-config-file.yml; NOT /label/some-config-file.yml
//
// See: https://jippi.github.io/scm-engine/configuration/#include.files
Files []string `json:"files" yaml:"files"`
// (Optional) Git reference to read the configuration from; it can be a tag, branch, or commit SHA.
//
// If omitted, HEAD is used; meaning your default branch.
//
// See: https://jippi.github.io/scm-engine/configuration/#include.ref
Ref *string `json:"ref,omitempty" yaml:"ref"`
}
type Label ¶
type Label struct {
// (Optional) Strategy used for the label
//
// - "conditional" will, based on the boolean output of [script], control if the label [name] should be added/removed on the MR
// - "computed" will, based on the list of strings output of [script], add/remove labels on the MR
//
// See: https://jippi.github.io/scm-engine/configuration/#label.strategy
Strategy labelType `json:"strategy,omitempty" yaml:"strategy" jsonschema:"default=conditional,enum=conditional,enum=generate"`
// Name of the label being generated.
//
// May only be used with [conditional] labelling type
//
// See: https://jippi.github.io/scm-engine/configuration/#label.name
Name string `json:"name,omitempty" yaml:"name" jsonschema:"dependentRequired"`
// (Optional) Description for the label being generated.
//
// See: https://jippi.github.io/scm-engine/configuration/#label.description
Description string `json:"description,omitempty" yaml:"description"`
// (Optional) 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
//
// See: https://jippi.github.io/scm-engine/configuration/#label.color
Color string `json:"color,omitempty" yaml:"color"`
// (Optional) 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.
//
// See: https://jippi.github.io/scm-engine/configuration/#label.priority
Priority types.Value[int] `json:"priority,omitempty" yaml:"priority"`
// Script contains the (https://expr-lang.org/) script used to emit labels for the MR.
//
// See: https://jippi.github.io/scm-engine/configuration/#label.script
Script string `json:"script" yaml:"script"`
// SkipIf is an optional (https://expr-lang.org/) script, returning a boolean, wether to
// skip (true) or process (false) this label step.
//
// See: https://jippi.github.io/scm-engine/configuration/#label.skip_if
SkipIf string `json:"skip_if,omitempty" yaml:"skip_if"`
// contains filtered or unexported fields
}
func (*Label) Evaluate ¶
func (p *Label) Evaluate(ctx context.Context, evalContext scm.EvalContext) ([]scm.EvaluationResult, error)
func (*Label) ShouldSkip ¶
Click to show internal directories.
Click to hide internal directories.