label

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WIP                     = "WIP"
	StatusPrefix            = "status/"
	StatusNeedsTriage       = StatusPrefix + "0-needs-triage"
	StatusNeedsDesignReview = StatusPrefix + "1-needs-design-review"
	StatusNeedsReview       = StatusPrefix + "2-needs-review"
	StatusNeedsMerge        = StatusPrefix + "3-needs-merge"
)

status labels.

View Source
const (
	ContributorPrefix                  = "contributor/"
	ContributorWaitingForCorrections   = ContributorPrefix + "waiting-for-corrections"
	ContributorNeedMoreInformation     = ContributorPrefix + "need-more-information"
	ContributorWaitingForDocumentation = ContributorPrefix + "waiting-for-documentation"
	ContributorWaitingForFeedback      = ContributorPrefix + "waiting-for-feedback"
)

contributor labels.

View Source
const (
	SizeLabelPrefix = "size/"
	Small           = "S"
	Medium          = "M"
	Large           = "L"
)

size labels.

Variables

This section is empty.

Functions

func DetectAreas

func DetectAreas(ctx context.Context, client *github.Client, owner, repositoryName string, prNumber int, rules []Rule) ([]string, error)

DetectAreas for a Pull Request.

func GetCurrentSize

func GetCurrentSize(issueLabels []*github.Label) string

GetCurrentSize gets the size of a Pull Request.

func GetSizeLabel

func GetSizeLabel(ctx context.Context, client *github.Client, owner, repositoryName string, prNumber int, limits Limits) (string, error)

GetSizeLabel evaluates PR size (exclude vendor files).

func HasLabel

func HasLabel(issueLabels []*github.Label, label string) bool

HasLabel check if issue labels contains a specific label.

func HasStatus

func HasStatus(issueLabels []*github.Label) bool

HasStatus check if issue labels contains a status label.

Types

type Changes

type Changes struct {
	Number       int
	AdditionSum  int
	DeletionSum  int
	ChangedFiles int
}

Changes represents the changes of a Pull Request.

type Limit

type Limit struct {
	SumLimit   int
	DiffLimit  int
	FilesLimit int
}

Limit a set of Pull request limits.

type Limits

type Limits struct {
	Small  Limit
	Medium Limit
}

Limits a set of Pull request limits by size.

type Rule

type Rule struct {
	Label string
	Regex string
}

Rule Area rule.

Jump to

Keyboard shortcuts

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