CLI/TUI for drafting, repeating, and publishing daily standup updates as GitHub issues
github go cli golang management project tui daily
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(ghcli): accept report labels parameter in ListReportIssues and FindReportIssueByDate

+32 -7
+5 -5
internal/ghcli/issues.go
··· 182 182 return c.ViewIssue(ctx, repo, issues[0].Number) 183 183 } 184 184 185 - func (c *Client) ListReportIssues(ctx context.Context, repo string, limit int) ([]ReportIssue, error) { 186 - return c.searchIssues(ctx, repo, "", []string{"daily-update/report"}, limit, "") 185 + func (c *Client) ListReportIssues(ctx context.Context, repo string, labels []string, limit int) ([]ReportIssue, error) { 186 + return c.searchIssues(ctx, repo, "", labels, limit, "") 187 187 } 188 188 189 - func (c *Client) FindReportIssueByDate(ctx context.Context, repo string, date string) (ReportIssue, error) { 189 + func (c *Client) FindReportIssueByDate(ctx context.Context, repo string, labels []string, date string) (ReportIssue, error) { 190 190 title, err := daily.ReportTitleForDate(date) 191 191 if err != nil { 192 192 return ReportIssue{}, err 193 193 } 194 194 195 - issues, err := c.searchIssues(ctx, repo, "", []string{"daily-update/report"}, 5, fmt.Sprintf("%q in:title", title)) 195 + issues, err := c.searchIssues(ctx, repo, "", labels, 5, fmt.Sprintf("%q in:title", title)) 196 196 if err != nil { 197 197 return ReportIssue{}, err 198 198 } 199 199 200 200 if len(issues) == 0 { 201 - issues, err = c.searchIssues(ctx, repo, "", []string{"daily-update/report"}, 10, fmt.Sprintf("created:%s", date)) 201 + issues, err = c.searchIssues(ctx, repo, "", labels, 10, fmt.Sprintf("created:%s", date)) 202 202 if err != nil { 203 203 return ReportIssue{}, err 204 204 }
+27 -2
internal/ghcli/issues_test.go
··· 84 84 ]`), nil 85 85 }) 86 86 87 - issues, err := client.ListReportIssues(context.Background(), "prefapp/doc-daily-updates", 10) 87 + issues, err := client.ListReportIssues(context.Background(), "prefapp/doc-daily-updates", []string{"daily-update/report"}, 10) 88 88 if err != nil { 89 89 t.Fatalf("list report issues: %v", err) 90 90 } ··· 117 117 } 118 118 }) 119 119 120 - issue, err := client.FindReportIssueByDate(context.Background(), "prefapp/doc-daily-updates", "2026-04-16") 120 + issue, err := client.FindReportIssueByDate(context.Background(), "prefapp/doc-daily-updates", []string{"daily-update/report"}, "2026-04-16") 121 121 if err != nil { 122 122 t.Fatalf("find report issue: %v", err) 123 123 } 124 124 125 125 if issue.Body != "team report body" { 126 126 t.Fatalf("expected team report body, got %q", issue.Body) 127 + } 128 + } 129 + 130 + func TestFindReportIssueByDateUsesProvidedReportLabel(t *testing.T) { 131 + client := newForTests(func(_ context.Context, args ...string) ([]byte, error) { 132 + joined := strings.Join(args, " ") 133 + switch { 134 + case strings.Contains(joined, "issue list"): 135 + if !strings.Contains(joined, "--label async-daily/report") { 136 + t.Fatalf("expected async report label filter, got %q", joined) 137 + } 138 + return []byte(`[ 139 + {"number":482,"title":"[Daily Report] 2026/04/17","url":"https://example.com/482","state":"OPEN","createdAt":"2026-04-17T11:07:03Z","updatedAt":"2026-04-17T11:07:04Z"} 140 + ]`), nil 141 + case strings.Contains(joined, "issue view 482"): 142 + return []byte(`{"number":482,"title":"[Daily Report] 2026/04/17","body":"team report body","url":"https://example.com/482","state":"OPEN","createdAt":"2026-04-17T11:07:03Z","updatedAt":"2026-04-17T11:07:04Z"}`), nil 143 + default: 144 + t.Fatalf("unexpected gh command %q", joined) 145 + return nil, nil 146 + } 147 + }) 148 + 149 + _, err := client.FindReportIssueByDate(context.Background(), "prefapp/doc-asyncdaily", []string{"async-daily/report"}, "2026-04-17") 150 + if err != nil { 151 + t.Fatalf("find report issue: %v", err) 127 152 } 128 153 } 129 154