Documentation
¶
Index ¶
- Constants
- Variables
- func LabelsToStrArr(labels []*github.Label) []string
- type AutoMergeAllowName
- type CompanyEmployees
- type LgtmRecord
- type Operator
- func (o *Operator) AddAllowList(owner, repo, username string) error
- func (o *Operator) CommentOnGithub(owner string, repo string, number int, commentBody string) error
- func (o *Operator) GetAllowList(owner, repo string) ([]string, error)
- func (o *Operator) GetGmailByGithubID(githubID string) (string, error)
- func (o *Operator) GetLGTMNumForPR(owner, repo string, pullNumber int) (num int, err error)
- func (o *Operator) GetLGTMReviewers(owner, repo string, pullNumber int) (reviewers []string, err error)
- func (o *Operator) GetNumberOFLGTMByLable(repo string, labels []*github.Label) int
- func (o *Operator) GetRolesInSigByGithubID(githubID string) (members []*SigMember, err error)
- func (o *Operator) HasPermissionToPRWithLables(owner, repo string, labels []*github.Label, githubID string, roles []string) error
- func (o *Operator) IsAllowed(owner, repo string, usernames ...string) bool
- func (o *Operator) IsInCompany(githubID string) (bool, error)
- func (o *Operator) ListLabelsOnGithub(owner, repo string) ([]*github.Label, error)
- func (o *Operator) ListSIGByLabel(repo string, labels []*github.Label) (sigs []*Sig, err error)
- func (o *Operator) RemoveAllowList(username string) error
- type Sig
- type SigMember
Constants ¶
View Source
const ( ROLE_PMC = "pmc" ROLE_MAMINTAINER = "maintainer" ROLE_LEADER = "leader" ROLE_COLEADER = "co-leader" ROLE_COMMITTER = "committer" ROLE_REVIEWER = "reviewer" )
View Source
const (
LABEL_REQUIRE_LGT = "require-LGT"
)
Variables ¶
View Source
var ( MERGE_ROLES = []string{ROLE_COMMITTER, ROLE_COLEADER, ROLE_LEADER} REVIEW_ROLES = []string{ROLE_REVIEWER, ROLE_COMMITTER, ROLE_COLEADER, ROLE_LEADER} LABEL_REQUIRE_LGTM_LOWER = strings.ToLower(LABEL_REQUIRE_LGT) )
Functions ¶
func LabelsToStrArr ¶
Types ¶
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 CompanyEmployees ¶
type LgtmRecord ¶
type Operator ¶
type Operator struct { Config *config.Config DB *db.DB Github *github.Client Slack slack.Bot Member *member.Member }
Operator contains pkg instances
func InitOperator ¶
InitOperator create context from config
func (*Operator) AddAllowList ¶
func (*Operator) CommentOnGithub ¶
CreateComment creates a new comment on the specified issue. number: issue or pull request's ID
func (*Operator) GetAllowList ¶
func (*Operator) GetGmailByGithubID ¶
func (*Operator) GetLGTMNumForPR ¶
func (*Operator) GetLGTMReviewers ¶
func (*Operator) GetNumberOFLGTMByLable ¶
func (*Operator) GetRolesInSigByGithubID ¶
func (*Operator) HasPermissionToPRWithLables ¶
func (*Operator) ListLabelsOnGithub ¶
func (*Operator) ListSIGByLabel ¶
func (*Operator) RemoveAllowList ¶
Click to show internal directories.
Click to hide internal directories.