Documentation
¶
Index ¶
- type Client
- type CurrentApproval
- type GHClient
- func (gh *GHClient) AddComment(comment string) error
- func (gh *GHClient) AllApprovals() ([]*CurrentApproval, error)
- func (gh *GHClient) ApprovePR() error
- func (gh *GHClient) CheckApprovals(fileReviewerMap map[string][]string, approvals []*CurrentApproval, ...) (approvers []string, staleApprovals []*CurrentApproval)
- func (gh *GHClient) ContainsValidBypassApproval(allowedUsers []string) (bool, error)
- func (gh *GHClient) DismissStaleReviews(staleApprovals []*CurrentApproval) error
- func (gh *GHClient) FindExistingComment(prefix string, since *time.Time) (int64, bool, error)
- func (gh *GHClient) FindUserApproval(ghUser string) (*CurrentApproval, error)
- func (gh *GHClient) GetAlreadyReviewed() ([]string, error)
- func (gh *GHClient) GetCurrentReviewerApprovals() ([]*CurrentApproval, error)
- func (gh *GHClient) GetCurrentlyRequested() ([]string, error)
- func (gh *GHClient) GetTokenUser() (string, error)
- func (gh *GHClient) InitComments() error
- func (gh *GHClient) InitPR(pr_id int) error
- func (gh *GHClient) InitReviews() error
- func (gh *GHClient) InitUserReviewerMap(reviewers []string) error
- func (gh *GHClient) IsInComments(comment string, since *time.Time) (bool, error)
- func (gh *GHClient) IsInLabels(labels []string) (bool, error)
- func (gh *GHClient) IsRepositoryAdmin(username string) (bool, error)
- func (gh *GHClient) IsSubstringInComments(substring string, since *time.Time) (bool, error)
- func (gh *GHClient) PR() *github.PullRequest
- func (gh *GHClient) RequestReviewers(reviewers []string) error
- func (gh *GHClient) SetInfoBuffer(writer io.Writer)
- func (gh *GHClient) SetWarningBuffer(writer io.Writer)
- func (gh *GHClient) UpdateComment(commentID int64, body string) error
- type NoPRError
- type UserReviewerMapNotInitError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
SetWarningBuffer(writer io.Writer)
SetInfoBuffer(writer io.Writer)
InitPR(pr_id int) error
PR() *github.PullRequest
InitUserReviewerMap(reviewers []string) error
GetTokenUser() (string, error)
InitReviews() error
AllApprovals() ([]*CurrentApproval, error)
FindUserApproval(ghUser string) (*CurrentApproval, error)
GetCurrentReviewerApprovals() ([]*CurrentApproval, error)
GetAlreadyReviewed() ([]string, error)
GetCurrentlyRequested() ([]string, error)
DismissStaleReviews(staleApprovals []*CurrentApproval) error
RequestReviewers(reviewers []string) error
ApprovePR() error
InitComments() error
AddComment(comment string) error
FindExistingComment(prefix string, since *time.Time) (int64, bool, error)
UpdateComment(commentID int64, body string) error
IsInComments(comment string, since *time.Time) (bool, error)
IsSubstringInComments(substring string, since *time.Time) (bool, error)
CheckApprovals(fileReviewerMap map[string][]string, approvals []*CurrentApproval, originalDiff git.Diff) (approvers []string, staleApprovals []*CurrentApproval)
IsInLabels(labels []string) (bool, error)
IsRepositoryAdmin(username string) (bool, error)
ContainsValidBypassApproval(allowedUsers []string) (bool, error)
}
type CurrentApproval ¶
func (*CurrentApproval) String ¶
func (p *CurrentApproval) String() string
type GHClient ¶ added in v0.1.3
type GHClient struct {
// contains filtered or unexported fields
}
func (*GHClient) AddComment ¶ added in v0.1.3
func (*GHClient) AllApprovals ¶ added in v0.1.3
func (gh *GHClient) AllApprovals() ([]*CurrentApproval, error)
func (*GHClient) CheckApprovals ¶ added in v0.1.3
func (gh *GHClient) CheckApprovals( fileReviewerMap map[string][]string, approvals []*CurrentApproval, originalDiff git.Diff, ) (approvers []string, staleApprovals []*CurrentApproval)
Apply approver satisfaction to the owners map, and return the approvals which should be invalidated
func (*GHClient) ContainsValidBypassApproval ¶ added in v1.2.0
ContainsValidBypassApproval checks if any approval is a valid admin bypass approval
func (*GHClient) DismissStaleReviews ¶ added in v0.1.3
func (gh *GHClient) DismissStaleReviews(staleApprovals []*CurrentApproval) error
func (*GHClient) FindExistingComment ¶ added in v0.2.0
func (*GHClient) FindUserApproval ¶ added in v0.1.3
func (gh *GHClient) FindUserApproval(ghUser string) (*CurrentApproval, error)
func (*GHClient) GetAlreadyReviewed ¶ added in v0.1.3
func (*GHClient) GetCurrentReviewerApprovals ¶ added in v0.1.3
func (gh *GHClient) GetCurrentReviewerApprovals() ([]*CurrentApproval, error)
func (*GHClient) GetCurrentlyRequested ¶ added in v0.1.3
func (*GHClient) GetTokenUser ¶ added in v0.1.3
func (*GHClient) InitComments ¶ added in v0.1.3
func (*GHClient) InitReviews ¶ added in v0.1.3
func (*GHClient) InitUserReviewerMap ¶ added in v0.1.3
func (*GHClient) IsInComments ¶ added in v0.1.3
func (*GHClient) IsInLabels ¶ added in v0.1.3
IsInLabels checks if the PR has any of the given labels
func (*GHClient) IsRepositoryAdmin ¶ added in v1.2.0
IsRepositoryAdmin checks if a user has admin permissions for the repository
func (*GHClient) IsSubstringInComments ¶ added in v0.1.3
func (*GHClient) PR ¶ added in v0.1.3
func (gh *GHClient) PR() *github.PullRequest
func (*GHClient) RequestReviewers ¶ added in v0.1.3
func (*GHClient) SetInfoBuffer ¶ added in v0.1.3
func (*GHClient) SetWarningBuffer ¶ added in v0.1.3
type UserReviewerMapNotInitError ¶
type UserReviewerMapNotInitError struct{}
func (UserReviewerMapNotInitError) Error ¶
func (e UserReviewerMapNotInitError) Error() string
Click to show internal directories.
Click to hide internal directories.