Documentation ¶
Index ¶
- Variables
- type Category
- type Client
- type CombinedStatus
- type CommitFile
- type ConanCenterReviewers
- type Label
- type ListOptions
- type PullRequest
- type PullRequestListOptions
- type PullRequestReview
- type PullRequestService
- type PullRequestSummary
- type RateLimit
- type RepoStatus
- type RepositoryService
- type Response
- type Review
- type Reviewer
- type ReviewerType
- type Reviews
- type WorkingRepository
Constants ¶
This section is empty.
Variables ¶
var ErrBumpLabel = errors.New("the pull request is labelled as bump and will automatically be merged")
ErrStoppedLabel indicates the pull request only has minor impact and is automatically handled by the bot, does not require attention
var ErrInvalidChange = errors.New("the files, or lack thereof, make this PR invalid")
ErrInvalidChange in the commit files of the pull request which break the rules of CCI
var ErrNoCommitStatus = errors.New("no repository status avialble for this commit")
ErrNoCommitStatus available
var ErrNoReviews = errors.New("no reviews on pull request")
ErrNoReviews indicated there were no reviews on a pull request and a summary could not be generated
var ErrStoppedLabel = errors.New("the pull request contains at least one label indicated that progress has stopped")
ErrStoppedLabel indicates there is an issue with the pull request
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category int
Category describing the type of change being introduced by the pull request
type Client ¶
type Client struct { *github.Client Repository *RepositoryService PullRequest *PullRequestService WorkingRepository WorkingRepository // contains filtered or unexported fields }
A Client manages communication with the GitHub API. This wraps the github.Client and provides convenient access to interrupt information from CCI perspective
type CombinedStatus ¶
type CombinedStatus = github.CombinedStatus
CombinedStatus represents the combined status of a repository at a particular reference.
type CommitFile ¶
type CommitFile = github.CommitFile
CommitFile represents a file modified in a commit.
type ConanCenterReviewers ¶
type ConanCenterReviewers struct {
Reviewers []Reviewer `yaml:"reviewers"`
}
func DownloadKnownReviewersList ¶
func DownloadKnownReviewersList(context context.Context, client *Client) (*ConanCenterReviewers, error)
func (*ConanCenterReviewers) IsCommunityMember ¶
func (reviewers *ConanCenterReviewers) IsCommunityMember(reviewerName string) bool
func (*ConanCenterReviewers) IsTeamMember ¶
func (reviewers *ConanCenterReviewers) IsTeamMember(reviewerName string) bool
type ListOptions ¶
type ListOptions = github.ListOptions
ListOptions specifies the optional parameters to various List methods that support offset pagination.
type PullRequest ¶
type PullRequest = github.PullRequest
PullRequest represents a GitHub pull request on a repository.
type PullRequestListOptions ¶
type PullRequestListOptions = github.PullRequestListOptions
PullRequestListOptions specifies the optional parameters to the Pull Request service
type PullRequestReview ¶
type PullRequestReview = github.PullRequestReview
PullRequestReview represents a review of a pull request.
func FilterAuthor ¶
func FilterAuthor(reviews []*PullRequestReview, author string) []*PullRequestReview
FilterAuthor removes any reviews by a given user's login
type PullRequestService ¶
type PullRequestService service
PullRequestService handles communication with the pull request related methods of the GitHub API
func (*PullRequestService) GetReviewSummary ¶
func (s *PullRequestService) GetReviewSummary(ctx context.Context, owner string, repo string, reviewers *ConanCenterReviewers, pr *PullRequest) (*PullRequestSummary, *Response, error)
GetReviewSummary of a specific pull request
func (*PullRequestService) ListAllReviews ¶
func (s *PullRequestService) ListAllReviews(ctx context.Context, owner string, repo string, number int) ([]*PullRequestReview, *Response, error)
ListAllReviews lists all reviews on the specified pull request.
type PullRequestSummary ¶
type PullRequestSummary struct { Number int OpenedBy string CreatedAt time.Time Recipe string Change Category ReviewURL string LastCommitSHA string LastCommitAt time.Time CciBotPassed bool Summary Reviews }
PullRequestSummary regarding its location in the review process of conan-center-index. See https://github.com/conan-io/conan-center-index/blob/master/docs/review_process.md for more information
type RepoStatus ¶
type RepoStatus = github.RepoStatus
RepoStatus represents the status of a repository at a particular reference.
type RepositoryService ¶
type RepositoryService service
RepositoryService handles communication with the repository related methods of the GitHub API
type Reviewer ¶
type Reviewer struct { User string `yaml:"user"` Type ReviewerType `yaml:"type"` Requested bool `yaml:"request_reviews"` }
type ReviewerType ¶
type ReviewerType string
const ( Team ReviewerType = "team" Community ReviewerType = "community" )
type Reviews ¶
type Reviews struct { Count int // Total number of comments, requested changes, and approvals ValidApprovals int // Counted by head commit approvals from official community reviewers and the Conan team TeamApproval bool // At least one approval from the Conan team Approvals []string // List of users who have approved the pull request on the head commit Blockers []string // List of Conan team members who have requested changes on the head commit LastReview *Review `json:",omitempty"` // Snapshot of the last review }
Reviews summarizes all the reviews of a given pull request
func ProcessReviewComments ¶
func ProcessReviewComments(reviewers *ConanCenterReviewers, reviews []*PullRequestReview, sha string) Reviews
ProcessReviewComments interprets the all the reviews to extract a summary based on the requirements of CCI
func (*Reviews) IsApproved ¶
IsApproved when the conditions for merging are meet as per https://github.com/conan-io/conan-center-index/blob/master/docs/review_process.md
type WorkingRepository ¶
WorkingRepository when using the client to access or publish data