tools: always process old PRs in show-pr
The Stats processing function ignores old closed items, but we want
the show-pr command to process them, so separate the internal
processing API from the public one.
@@ -65,16 +65,19 @@ type Stats struct {
// Populate runs the query and filters requests into the appropriate
// buckets
func (s *Stats) Populate() error {
- return s.Query.IteratePullRequests(s.ProcessOne)
+ return s.Query.IteratePullRequests(s.process)
}
// Process extracts the required information from a single PR
-func (s *Stats) ProcessOne(pr *github.PullRequest) error {
+func (s *Stats) process(pr *github.PullRequest) error {
// Ignore old closed items
if !s.EarliestDate.IsZero() && *pr.State == "closed" && pr.UpdatedAt.Before(s.EarliestDate) {
return nil
}
+ return s.ProcessOne(pr)
+}
+func (s *Stats) ProcessOne(pr *github.PullRequest) error {
isMerged, err := s.Query.IsMerged(pr)
if err != nil {
return errors.Wrap(err,
