merge

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeStatusMessage

func MergeStatusMessage(status int) string

Types

type AutoMerge

type AutoMerge struct {
	ID        int       `gorm:"column:id"`
	PrID      int       `gorm:"column:pull_number"`
	Owner     string    `gorm:"column:owner"`
	Repo      string    `gorm:"column:repo"`
	BaseRef   string    `gorm:"column:base_ref"`
	Started   bool      `gorm:"column:started"`
	Status    int       `gorm:"column:status"`
	CreatedAt time.Time `gorm:"column:created_at"`
}

AutoMerge define merge database structure

type AutoMergeAllowName

type AutoMergeAllowName struct {
	ID        int       `gorm:"id"`
	Owner     string    `gorm:"owner"`
	Repo      string    `gorm:"repo"`
	Username  string    `gorm:"	username"`
	CreatedAt time.Time `gorm:"created_at"`
}

AutoMergeAllowName define allow name for auto merge

type Merge

type Merge interface {
	Ready()
	ProcessPullRequestEvent(event *github.PullRequestEvent)
	ProcessIssueCommentEvent(event *github.IssueCommentEvent)
	GetAllowList() ([]string, error)
	AddAllowList(username string) error
	RemoveAllowList(username string) error
	StatisticRepo(owner, repo string) (*StatusStatistic, error)
	StatisticAllRepos() ([]*StatusStatistic, error)
}

Merge defines methods of auto merge

func Init

func Init(repo *config.RepoConfig, opr *operator.Operator) Merge

Init create PR limit middleware instance

type ReleaseMember

type ReleaseMember struct {
	ID     int    `gorm:"column:id"`
	Owner  string `gorm:"column:owner"`
	Repo   string `gorm:"column:repo"`
	Branch string `gorm:"column:branch"`
	User   string `gorm:"column:user"`
}

ReleaseMember can merge PR to branches during release time

type ReleaseVersion

type ReleaseVersion struct {
	ID      int        `gorm:"column:id"`
	Owner   string     `gorm:"column:owner"`
	Repo    string     `gorm:"column:repo"`
	Branch  string     `gorm:"column:branch"`
	Version string     `gorm:"column:version"`
	Start   *time.Time `gorm:"column:start"`
	End     *time.Time `gorm:"column:end"`
}

ReleaseVersion for release records

type StatusCount

type StatusCount struct {
	Owner  string `gorm:"column:owner"`
	Repo   string `gorm:"column:repo"`
	Status int    `gorm:"column:status"`
	Count  uint64 `gorm:"column:cnt"`
}

StatusCount is the count for one status of a repo

type StatusStatistic

type StatusStatistic struct {
	Owner       string  `json:"owner"`
	Repo        string  `json:"repo"`
	SuccessRate float32 `json:"success_rate"`
	Incomplete  uint64  `json:"incomplete"`
	Finish      uint64  `json:"finish"`
	Success     uint64  `json:"success"`
	TestFail    uint64  `json:"test_fail"`
	MergeFail   uint64  `json:"merge_fail"`
}

StatusStatistic is the merge status statistic for a repo

func MakeStatusStatistic

func MakeStatusStatistic(counts []*StatusCount) []*StatusStatistic

Jump to

Keyboard shortcuts

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