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(cmd): add reportLabels helper to derive report labels from configured labels

+44 -2
+2 -2
cmd/report.go
··· 30 30 } 31 31 32 32 if list { 33 - issues, err := env.gh.ListReportIssues(ctx, env.cfg.GitHubRepo, limit) 33 + issues, err := env.gh.ListReportIssues(ctx, env.cfg.GitHubRepo, reportLabels(env.cfg.Labels), limit) 34 34 if err != nil { 35 35 return err 36 36 } ··· 54 54 return err 55 55 } 56 56 57 - issue, err := env.gh.FindReportIssueByDate(ctx, env.cfg.GitHubRepo, resolvedDate) 57 + issue, err := env.gh.FindReportIssueByDate(ctx, env.cfg.GitHubRepo, reportLabels(env.cfg.Labels), resolvedDate) 58 58 if err != nil { 59 59 if errors.Is(err, ghcli.ErrIssueNotFound) { 60 60 return fmt.Errorf("no daily update report issue found for %s", resolvedDate)
+18
cmd/support.go
··· 4 4 "context" 5 5 "errors" 6 6 "fmt" 7 + "strings" 7 8 "time" 8 9 9 10 "github.com/vieitesss/pad/internal/appfs" ··· 107 108 108 109 return env.gh.CreateIssue(ctx, env.cfg.GitHubRepo, title, entry.Body(), env.cfg.Labels) 109 110 } 111 + 112 + func reportLabels(labels []string) []string { 113 + for _, label := range labels { 114 + label = strings.TrimSpace(label) 115 + if label == "" { 116 + continue 117 + } 118 + 119 + if strings.HasSuffix(label, "/member") { 120 + return []string{strings.TrimSuffix(label, "/member") + "/report"} 121 + } 122 + 123 + return []string{label + "/report"} 124 + } 125 + 126 + return []string{"daily-update/report"} 127 + }
+24
cmd/support_test.go
··· 1 + package cmd 2 + 3 + import "testing" 4 + 5 + func TestReportLabels(t *testing.T) { 6 + tests := []struct { 7 + name string 8 + labels []string 9 + want string 10 + }{ 11 + {name: "member suffix", labels: []string{"async-daily/member"}, want: "async-daily/report"}, 12 + {name: "plain prefix", labels: []string{"daily-update"}, want: "daily-update/report"}, 13 + {name: "fallback default", labels: nil, want: "daily-update/report"}, 14 + } 15 + 16 + for _, tt := range tests { 17 + t.Run(tt.name, func(t *testing.T) { 18 + got := reportLabels(tt.labels) 19 + if len(got) != 1 || got[0] != tt.want { 20 + t.Fatalf("reportLabels(%v) = %v, want [%s]", tt.labels, got, tt.want) 21 + } 22 + }) 23 + } 24 + }