config

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Github   *Github
	Slack    *Slack
	Repos    map[string]*RepoConfig
	Database *Database
	Member   Member `toml:"member"`
}

Config is cherry picker config struct

func GetConfig

func GetConfig(configPath *string) (*Config, error)

GetConfig read config file

type Database

type Database struct {
	Address  string
	Port     int
	Username string
	Password string
	Dbname   string
}

Database is db connect config

type Github

type Github struct {
	Token string
	Bot   string
}

Github config

type Member

type Member struct {
	Orgs  []string `toml:"orgs"`
	Users []string `toml:"users"`
}

Member config

type PullStatusControl

type PullStatusControl struct {
	Label  string                    `toml:"label"`
	Cond   string                    `toml:"cond"`
	Events []*PullStatusControlEvent `toml:"event"`
}

PullStatusControl is pull status control for a specific label

type PullStatusControlEvent

type PullStatusControlEvent struct {
	Duration int    `toml:"duration"`
	Events   string `toml:"events"`
}

PullStatusControlEvent is a rule for pull status control

type Redeliver

type Redeliver struct {
	Label   string
	Keyword string
	Exclude string
	Channel string
}

Redeliver is struct of redeliver rule

type RepoConfig

type RepoConfig struct {
	// common config
	GithubBotChannel string  `toml:"github-bot-channel"`
	Member           *Member `toml:"member"`
	// repo config
	Owner          string `toml:"owner"`
	Repo           string `toml:"repo"`
	Interval       int    `toml:"interval"`
	Fullupdate     int    `toml:"fullupdate"`
	WebhookSecret  string `toml:"webhook-secret"`
	RunTestCommand string `toml:"run-test-command"`
	// cherry picker config
	CherryPick          bool   `toml:"cherry-pick"`
	Dryrun              bool   `toml:"dryrun"`
	Rule                string `toml:"cherry-pick-rule"`
	Release             string `toml:"cherry-pick-release"`
	TypeLabel           string `toml:"cherry-type-label"`
	ReplaceLabel        string `toml:"cherry-replace-label"`
	IgnoreLabel         string `toml:"ignore-label"`
	CherryPickChannel   string `toml:"cherry-pick-channel"`
	CherryConflict      bool   `toml:"cherry-pick-conflict"`
	SquashMerge         bool   `toml:"cherry-pick-squash"`
	CherryPickMilestone bool   `toml:"cherry-pick-milestone"`
	CherryPickAssign    bool   `toml:"cherry-pick-assign"`
	// label check config
	LabelCheck          bool   `toml:"label-check"`
	ShortCheckDuration  int    `toml:"short-check-duration"`
	MediumCheckDuration int    `toml:"medium-check-duration"`
	LongCheckDuration   int    `toml:"long-check-duration"`
	CommonChecker       string `toml:"common-checker"`
	ChiefChecker        string `toml:"chief-checker"`
	LabelCheckChannel   string `toml:"label-check-channel"`
	DefaultChecker      string `toml:"default-checker"`
	InviteCollaborator  bool   `toml:"invite-collaborator"`

	// pr limit config
	PrLimit          bool   `toml:"pr-limit"`
	MaxPrOpened      int    `toml:"max-pr-opened"`
	PrLimitMode      string `toml:"pr-limit-mode"`
	PrLimitOrgs      string `toml:"pr-limit-orgs"`
	PrLimitLabel     string `toml:"pr-limit-label"`
	ContributorLabel string `toml:"contributor-label"`
	// merge config
	Merge                bool   `toml:"auto-merge"`
	CanMergeLabel        string `toml:"can-merge-label"`
	ReleaseAccessControl bool   `toml:"release-access-control"`
	ReleaseLGTMNeed      int    `toml:"release-lgtm-need"`
	SignedOffMessage     bool   `toml:"signed-off-message"`
	MergeSIGControl      bool   `toml:"merge-sig-control"`
	// issue redeliver
	IssueRedeliver bool         `toml:"issue-redeliver"`
	Redeliver      []*Redeliver `toml:"redeliver"`
	// pull request status control
	StatusControl     bool                 `toml:"status-control"`
	LabelOutdated     string               `toml:"label-outdated"`
	NoticeChannel     string               `toml:"notice-channel"`
	PullStatusControl []*PullStatusControl `toml:"pull-status-control"`
	// auto update config
	AutoUpdate        bool              `toml:"auto-update"`
	AutoUpdateChannel string            `toml:"auto-update-channel"`
	UpdateOwner       string            `toml:"update-owner"`
	UpdateRepo        string            `toml:"update-repo"`
	UpdateTargetMap   map[string]string `toml:"update-target-map"`
	UpdateScript      string            `toml:"update-script"`
	MergeLabel        string            `toml:"merge-label"`
	UpdateAutoMerge   bool              `toml:"update-auto-merge"`
	// issue notify
	IssueSlackNotice        bool   `toml:"issue-slack-notice"`
	IssueSlackNoticeChannel string `toml:"issue-slack-notice-channel"`
	IssueSlackNoticeNotify  string `toml:"issue-slack-notice-notify"`
	// approve
	PullApprove bool `toml:"pull-approve"`
	// contributor
	NotifyNewContributorPR bool `toml:"notify-new-contributor-pr"`
	// watch file change
	WatchFiles       []*WatchFile `toml:"watch-file"`
	WatchFileChannel string       `toml:"watch-file-channel"`
}

RepoConfig is single repo config

type Slack

type Slack struct {
	Token     string
	Heartbeat string
	Mute      bool
	Hello     bool
}

Slack config

type WatchFile

type WatchFile struct {
	Path     string   `toml:"path"`
	Branches []string `toml:"branch"`
}

WatchFile watches file change

Jump to

Keyboard shortcuts

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