config

package
v0.0.0-...-42af38f Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentCapacity

func ComponentCapacity(config *CapacityConfig, name string) (bool, int)

func HasMergeWindow

func HasMergeWindow(c MergeWindowConfig) bool

func IsMergeWindowOpen

func IsMergeWindowOpen(c MergeWindowConfig) bool

Types

type CapacityConfig

type CapacityConfig struct {
	Groups []ComponentGroup `yaml:"groups"`

	// MaximumTotalPicks is total number if pull request approved regardless of component
	MaximumTotalPicks int `yaml:"maxTotalPicks"`

	// MaximumdefaultPicksPerComponent is default capacity for component when there is no capacity defined.
	MaximumDefaultPicksPerComponent int `yaml:"maxDefaultPicksPerComponent"`
}

CapacityConfig define a list of component and their QE capacity

type ClassifierConfig

type ClassifierConfig struct {
	KeywordsClassifier  KeywordsClassifierConfig  `yaml:"keywords"`
	ComponentClassifier ComponentClassifierConfig `yaml:"components"`
	Severities          SeverityClassifierConfig  `yaml:"severities"`
	PMScores            PMScoreClassifierConfig   `yaml:"pmScores"`
}

type ComponentClassifierConfig

type ComponentClassifierConfig map[string]float32

type ComponentGroup

type ComponentGroup struct {
	Name       string   `yaml:"name"`
	Capacity   int      `yaml:"capacity"`
	Components []string `yaml:"components"`
}

type KeywordsClassifierConfig

type KeywordsClassifierConfig map[string]float32

type MergeWindowConfig

type MergeWindowConfig struct {
	From string `yaml:"from,omitempty"`
	To   string `yaml:"to,omitempty"`
}

type PMScoreClassifierConfig

type PMScoreClassifierConfig []PMScoreRange

type PMScoreRange

type PMScoreRange struct {
	From  int     `yaml:"from"`
	To    int     `yaml:"to"`
	Score float32 `yaml:"score"`
}

type PatchManagerConfig

type PatchManagerConfig struct {
	Release            string            `yaml:"release"`
	CapacityConfig     CapacityConfig    `yaml:"capacity"`
	ClassifiersConfigs ClassifierConfig  `yaml:"classifiers"`
	RulesConfig        RulesConfig       `yaml:"rules"`
	MergeWindowConfig  MergeWindowConfig `yaml:"mergeWindow"`
}

func GetConfig

func GetConfig(location string) (*PatchManagerConfig, error)

GetConfig gets a configuration file either locally or remotely via HTTP or HTTPS client.

type PullRequestLabelRuleConfig

type PullRequestLabelRuleConfig struct {
	RefuseOnLabel []string `yaml:"refuse"`
	RequireLabel  []string `yaml:"require"`
}

type RulesConfig

type RulesConfig struct {
	PullRequestLabelConfig PullRequestLabelRuleConfig `yaml:"labels"`
}

type SeverityClassifierConfig

type SeverityClassifierConfig map[string]float32

Jump to

Keyboard shortcuts

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