stats

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 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 Bucket

type Bucket struct {
	// Rule tells us which pull requests belong in the bucket
	Rule RuleFilter
	// Requests is the set of pull requests in the bucket
	Requests []*PullRequestDetails
	// Cascade tells us whether to keep looking for other buckets. The
	// default, false, means stop when Rule matches. Setting Cascade =
	// true means requests added to the bucket may be added to other
	// buckets.
	Cascade bool
}

Bucket describes a rule for selecting pull requests to group them into a category

type PullRequestDetails

type PullRequestDetails struct {
	Pull *github.PullRequest

	// These are groups of comments, submited with a review action
	Reviews           []*github.PullRequestReview
	RecentReviewCount int

	// These are "review comments", associated with a diff
	PullRequestComments  []*github.PullRequestComment
	RecentPRCommentCount int

	// PRs are also issues, so these are the standard comments
	IssueComments           []*github.IssueComment
	RecentIssueCommentCount int

	// Updates show as commits
	Commits []*github.RepositoryCommit

	RecentActivityCount int
	AllActivityCount    int

	State string
}

PullRequestDetails includes the PullRequest and some supplementary data

type RuleFilter

type RuleFilter func(*PullRequestDetails) bool

RuleFilter refers to a function that selects pull requests. A RuleFilter returns true when the request matches, false when it does not.

type Stats

type Stats struct {
	Query        *util.PullRequestQuery
	EarliestDate time.Time
	Buckets      []*Bucket
}

Stats holds the overall stats gathered from the repo

func (*Stats) Populate

func (s *Stats) Populate(ctx context.Context) error

Populate runs the query and filters requests into the appropriate buckets

func (*Stats) ProcessOne

func (s *Stats) ProcessOne(ctx context.Context, pr *github.PullRequest) error

Jump to

Keyboard shortcuts

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