diff --git a/tools/github-manage/cmd/gm/milestone.go b/tools/github-manage/cmd/gm/milestone.go index 82bff393f4..2ef490c06d 100644 --- a/tools/github-manage/cmd/gm/milestone.go +++ b/tools/github-manage/cmd/gm/milestone.go @@ -157,8 +157,9 @@ var milestoneReportCmd = &cobra.Command{ projects = filtered } } - headers := make([]string, 0, len(projects)+2) + headers := make([]string, 0, len(projects)+3) headers = append(headers, "Number") + headers = append(headers, "Assignees") for _, p := range projects { if p.Title != "" { title := p.Title @@ -211,7 +212,7 @@ var milestoneReportCmd = &cobra.Command{ pids = append(pids, p.ID) } statuses, _ := ghapi.GetIssueProjectStatuses(num, pids) - row := []string{fmt.Sprintf("%d", num)} + row := []string{fmt.Sprintf("%d", num), fmt.Sprintf("%d", len(mi.Assignees))} for _, pid := range pids { ps, ok := statuses[pid] if !ok || !ps.Present { diff --git a/tools/github-manage/pkg/ghapi/milestone.go b/tools/github-manage/pkg/ghapi/milestone.go index 4dc197ee59..85669aed75 100644 --- a/tools/github-manage/pkg/ghapi/milestone.go +++ b/tools/github-manage/pkg/ghapi/milestone.go @@ -43,7 +43,7 @@ func GetIssuesByMilestoneWithTitles(name string, limit int) ([]MilestoneIssue, e if limit <= 0 { limit = 1000 } - cmd := fmt.Sprintf("gh issue list --state all --milestone %q --limit %d --json number,title,labels", name, limit) + cmd := fmt.Sprintf("gh issue list --state all --milestone %q --limit %d --json number,title,labels,assignees", name, limit) out, err := RunCommandAndReturnOutput(cmd) if err != nil { return nil, err @@ -68,6 +68,9 @@ type MilestoneIssue struct { Labels []struct { Name string `json:"name"` } `json:"labels"` + Assignees []struct { + Login string `json:"login"` + } `json:"assignees"` } // GetIssueProjects returns projects (id->title) that a specific issue belongs to.