stats

package
v0.0.0-...-1b7c77f Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 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

	RecentActivityCount int
	AllActivityCount    int

	State         string
	LGTM          bool // lgtm
	Prioritized   bool // priority-important/soon or priority/critical-urgent
	Stale         bool // lifecycle/stale or lifecycle/rotten
	Group         string
	IsEnhancement bool
	ModifiedFiles []enhancements.ModifiedFile
	IsNew         bool
}

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
	LatestDate   time.Time
	Buckets      []*Bucket
	Summarizer   *enhancements.Summarizer
}

Stats holds the overall stats gathered from the repo

func (*Stats) Populate

func (s *Stats) Populate() error

Populate runs the query and filters requests into the appropriate buckets

func (*Stats) ProcessOne

func (s *Stats) ProcessOne(pr *github.PullRequest) error

Jump to

Keyboard shortcuts

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