gh

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	PR *github.PullRequest
	// contains filtered or unexported fields
}

func NewClient

func NewClient(owner, repo, token string) *Client

func (*Client) AddComment

func (gh *Client) AddComment(comment string) error

func (*Client) AllApprovals

func (gh *Client) AllApprovals() ([]*CurrentApproval, error)

func (*Client) ApprovePR

func (gh *Client) ApprovePR() error

func (*Client) CheckApprovals

func (gh *Client) 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 (*Client) DismissStaleReviews

func (gh *Client) DismissStaleReviews(staleApprovals []*CurrentApproval) error

func (*Client) FindUserApproval

func (gh *Client) FindUserApproval(ghUser string) (*CurrentApproval, error)

func (*Client) GetAlreadyReviewed

func (gh *Client) GetAlreadyReviewed() ([]string, error)

func (*Client) GetCurrentReviewerApprovals

func (gh *Client) GetCurrentReviewerApprovals() ([]*CurrentApproval, error)

func (*Client) GetCurrentlyRequested

func (gh *Client) GetCurrentlyRequested() ([]string, error)

func (*Client) GetTokenUser

func (gh *Client) GetTokenUser() (string, error)

func (*Client) InitComments

func (gh *Client) InitComments() error

func (*Client) InitPR

func (gh *Client) InitPR(pr_id int) error

func (*Client) InitReviews

func (gh *Client) InitReviews() error

func (*Client) InitUserReviewerMap

func (gh *Client) InitUserReviewerMap(reviewers []string) error

func (*Client) IsInComments

func (gh *Client) IsInComments(comment string, since *time.Time) (bool, error)

func (*Client) IsSubstringInComments

func (gh *Client) IsSubstringInComments(substring string, since *time.Time) (bool, error)

func (*Client) RequestReviewers

func (gh *Client) RequestReviewers(reviewers []string) error

func (*Client) SetInfoBuffer

func (gh *Client) SetInfoBuffer(writer io.Writer)

func (*Client) SetWarningBuffer

func (gh *Client) SetWarningBuffer(writer io.Writer)

type CurrentApproval

type CurrentApproval struct {
	GHLogin   string
	ReviewID  int64
	Reviewers []string
	CommitID  string
}

func (*CurrentApproval) String

func (p *CurrentApproval) String() string

type NoPRError

type NoPRError struct{}

func (NoPRError) Error

func (e NoPRError) Error() string

type UserReviewerMapNotInitError

type UserReviewerMapNotInitError struct{}

func (UserReviewerMapNotInitError) Error

Jump to

Keyboard shortcuts

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