repo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Port

type Port interface {
	// GetPullRequestsSince returns the list of pull requests since the given date.
	// If onlyMerged is true, only the merged pull requests since the given date are returned.
	// If onlyMerged is false, merged pull requests since the given date are returned + (still) open pull requests.
	GetPullRequestsSince(base string, t time.Time, onlyMerged bool) ([]PullRequest, error)
}

Port is the interface that must be implemented by repo adapters.

type PullRequest

type PullRequest struct {
	Number   int        // pull request number
	Title    string     // pull request title
	MergedAt *time.Time // pull request merge date (nil if not merged)
	Labels   []string   // pull request labels
}

PullRequest represents a pull request.

func (*PullRequest) IsIgnored added in v0.1.0

func (pr *PullRequest) IsIgnored(config PullRequestConfig) bool

IsIgnored returns true if the pull request is ignored. A pull request is considered ignored if it has at least one of the ignored labels.

func (*PullRequest) IsMajor

func (pr *PullRequest) IsMajor(config PullRequestConfig) bool

IsMajor returns true if the pull request is a major one. A pull request is considered major if it has at least one of the major labels.

func (*PullRequest) IsMerged

func (pr *PullRequest) IsMerged() bool

IsMerged returns true if the pull request is merged.

func (*PullRequest) IsMinor

func (pr *PullRequest) IsMinor(config PullRequestConfig) bool

IsMinor returns true if the pull request is a minor one. A pull request is considered minor if it has at least one of the minor labels.

func (*PullRequest) IsPatch

func (pr *PullRequest) IsPatch(config PullRequestConfig) bool

IsPatch returns true if the pull request is a patch one. A pull request is considered patch if it is neither major nor minor.

type PullRequestConfig

type PullRequestConfig struct {
	MajorLabels   []string
	MinorLabels   []string
	IgnoredLabels []string
}

PullRequestConfig holds labels to identify major and minor pull requests.

Jump to

Keyboard shortcuts

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