Skip to content

Commit

Permalink
Merge pull request #620 from dhellmann/report-show-stale
Browse files Browse the repository at this point in the history
tools: show old and stale enhancements by default
  • Loading branch information
openshift-merge-robot authored Feb 2, 2021
2 parents f54b83d + 1737c3c commit 9b80113
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions tools/cmd/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func newReportCommand() *cobra.Command {
var (
daysBack, staleMonths int
devMode, full bool
devMode bool
)

cmd := &cobra.Command{
Expand Down Expand Up @@ -102,7 +102,7 @@ func newReportCommand() *cobra.Command {
},
}

// Define some extra buckets for the "full" report format.
// Define some extra buckets for older or lingering items
revived := stats.Bucket{
Rule: func(prd *stats.PullRequestDetails) bool {
// Anything in either of these states from
Expand Down Expand Up @@ -195,41 +195,36 @@ func newReportCommand() *cobra.Command {
report.SortByActivityCountDesc(otherActive.Requests)
report.ShowPRs("Other Active", otherActive.Requests, true)

// Only print the closing sections if asked to with the --full flag
if !full {
return nil
}

report.SortByID(revived.Requests)
report.ShowPRs(
fmt.Sprintf("Revived (closed more than %d days ago, but with new comments)", daysBack),
revived.Requests,
false,
)

report.SortByID(idle.Requests)
report.ShowPRs(
fmt.Sprintf("Idle (no comments for at least %d days)", daysBack),
idle.Requests,
false,
)

report.SortByID(otherOld.Requests)
report.ShowPRs(
fmt.Sprintf("Other Old (older than %d months, but discussion in last %d days)",
fmt.Sprintf("Old (older than %d months, but discussion in last %d days)",
staleMonths, daysBack),
otherOld.Requests,
false,
)

report.SortByID(stale.Requests)
report.ShowPRs(
fmt.Sprintf("Other Stale (older than %d months, not discussed in last %d days)",
fmt.Sprintf("Stale (older than %d months, no discussion in last %d days)",
staleMonths, daysBack),
stale.Requests,
false,
)

report.SortByID(idle.Requests)
report.ShowPRs(
fmt.Sprintf("Idle (no comments for at least %d days)", daysBack),
idle.Requests,
false,
)

return nil
},
}
Expand All @@ -238,7 +233,6 @@ func newReportCommand() *cobra.Command {
cmd.Flags().IntVar(&staleMonths, "stale-months", 3,
"how many months before a pull request is considered stale")
cmd.Flags().BoolVar(&devMode, "dev", false, "dev mode, stop after first page of PRs")
cmd.Flags().BoolVar(&full, "full", false, "full report, not just summary")

return cmd
}
Expand Down

0 comments on commit 9b80113

Please sign in to comment.