Commit a8177dfad3f0

Vincent Demeester <vincent@sbr.pm>
2026-05-12 10:39:31
feat(daily-plan): add assigned PRs section
Added GitHub assigned PRs as a separate section in both the show and weekly views, alongside the existing assigned issues. Covers CLI, JSON output, and Emacs rendering.
1 parent b9c8efe
Changed files (3)
tools
daily-plan
cmd
daily-plan
internal
tools/daily-plan/cmd/daily-plan/main.go
@@ -109,6 +109,7 @@ type jsonShow struct {
 	JiraInProgress []jsonJira `json:"jira_in_progress"`
 	JiraBacklog    []jsonJira `json:"jira_backlog"`
 	GHIssues       []jsonGH   `json:"github_issues"`
+	GHAssignedPRs  []jsonGH   `json:"github_assigned_prs"`
 	GHReviews      []jsonGH   `json:"github_reviews"`
 	GHPRs          []jsonGH   `json:"github_prs"`
 }
@@ -278,6 +279,9 @@ func cmdShow(ctx context.Context, cfg *config.Config) error {
 		}
 		return github.FilterBots(r, cfg.GitHub.BotFilters), nil
 	})
+	ghAssignedPRs, _ := cache.GetOrFetch(apiCache, "show:assigned-prs:"+today, func() ([]github.Item, error) {
+		return github.FetchAssignedPRs(ctx, cfg.GitHub.Username, cfg.GitHub.Owners)
+	})
 	myPRs, _ := cache.GetOrFetch(apiCache, "show:myprs:"+today, func() ([]github.Item, error) {
 		return github.FetchMyPRs(ctx, cfg.GitHub.Username, cfg.GitHub.Owners)
 	})
@@ -293,6 +297,7 @@ func cmdShow(ctx context.Context, cfg *config.Config) error {
 			JiraInProgress: jiraToJSON(inprog, cfg.Jira.BaseURL),
 			JiraBacklog:    jiraToJSON(todo, cfg.Jira.BaseURL),
 			GHIssues:       ghToJSON(ghIssues),
+			GHAssignedPRs:  ghToJSON(ghAssignedPRs),
 			GHReviews:      ghToJSON(reviews),
 			GHPRs:          ghToJSON(myPRs),
 		})
@@ -310,6 +315,9 @@ func cmdShow(ctx context.Context, cfg *config.Config) error {
 	display.Header("GitHub — Assigned Issues")
 	display.GitHubItems(ghIssues, "issue")
 
+	display.Header("GitHub — Assigned PRs")
+	display.GitHubItems(ghAssignedPRs, "pr")
+
 	display.Header("GitHub — PRs Awaiting Your Review")
 	display.GitHubItems(reviews, "review")
 
@@ -586,6 +594,7 @@ type jsonWeekly struct {
 	JiraInProgress     []jsonJira       `json:"jira_in_progress"`
 	JiraBacklog        []jsonJira       `json:"jira_backlog"`
 	GHIssues           []jsonGH         `json:"github_issues"`
+	GHAssignedPRs      []jsonGH         `json:"github_assigned_prs"`
 }
 
 func cmdWeekly(ctx context.Context, cfg *config.Config) error {
@@ -618,6 +627,9 @@ func cmdWeekly(ctx context.Context, cfg *config.Config) error {
 	ghIssues, _ := cache.GetOrFetch(apiCache, "gh:assigned:"+mondayStr, func() ([]github.Item, error) {
 		return github.FetchAssignedIssues(ctx, cfg.GitHub.Username, cfg.GitHub.Owners)
 	})
+	ghAssignedPRs, _ := cache.GetOrFetch(apiCache, "gh:assigned-prs:"+mondayStr, func() ([]github.Item, error) {
+		return github.FetchAssignedPRs(ctx, cfg.GitHub.Username, cfg.GitHub.Owners)
+	})
 
 	orgDone, _ := cache.GetOrFetch(apiCache, "org:done:"+mondayStr, func() ([]org.DoneItem, error) {
 		return org.FetchDoneItems(cfg.Org.Files, cfg.Org.ArchiveDir, monday, nextMonday)
@@ -653,6 +665,7 @@ func cmdWeekly(ctx context.Context, cfg *config.Config) error {
 			JiraInProgress:  jiraToJSON(inprog, cfg.Jira.BaseURL),
 			JiraBacklog:     jiraToJSON(todo, cfg.Jira.BaseURL),
 			GHIssues:        ghToJSON(ghIssues),
+			GHAssignedPRs:   ghToJSON(ghAssignedPRs),
 		}
 		if !noDiscussions {
 			w.GHDiscussions = discussionsToJSON(discussions)
@@ -710,6 +723,9 @@ func cmdWeekly(ctx context.Context, cfg *config.Config) error {
 	display.SubHeader("GitHub Issues (assigned)")
 	display.GitHubItems(ghIssues, "issue")
 
+	display.SubHeader("GitHub PRs (assigned)")
+	display.GitHubItems(ghAssignedPRs, "pr")
+
 	display.Hint(fmt.Sprintf("Schedule items: daily-plan schedule SRVKP-1234 %s", nextMonday.Format("2006-01-02")))
 	return nil
 }
tools/daily-plan/internal/github/github.go
@@ -62,6 +62,19 @@ func FetchAssignedIssues(ctx context.Context, username string, owners []string)
 	return runGHSearch(ctx, args, "issue")
 }
 
+// FetchAssignedPRs returns open PRs assigned to user across owners.
+func FetchAssignedPRs(ctx context.Context, username string, owners []string) ([]Item, error) {
+	args := []string{
+		"search", "prs",
+		"--assignee", username,
+		"--state", "open",
+		"--limit", "30",
+		"--json", "repository,number,title,createdAt,author",
+	}
+	args = append(args, ownerFlags(owners)...)
+	return runGHSearch(ctx, args, "pr")
+}
+
 // FetchReviewRequests returns open PRs where review is requested from user.
 func FetchReviewRequests(ctx context.Context, username string, owners []string) ([]Item, error) {
 	args := []string{
tools/daily-plan/daily-plan.el
@@ -173,6 +173,9 @@
     (insert "\n** GitHub — Assigned Issues\n")
     (daily-plan--insert-items .github_issues #'daily-plan--insert-gh-item nil)
 
+    (insert "\n** GitHub — Assigned PRs\n")
+    (daily-plan--insert-items .github_assigned_prs #'daily-plan--insert-gh-item nil)
+
     (insert "\n** GitHub — PRs Awaiting Review  :review:\n")
     (daily-plan--insert-items .github_reviews #'daily-plan--insert-gh-item nil)
 
@@ -306,7 +309,10 @@
 
     ;; Assigned issues
     (insert "\n** GitHub Issues (assigned)\n")
-    (daily-plan--insert-items .github_issues #'daily-plan--insert-gh-item nil)))
+    (daily-plan--insert-items .github_issues #'daily-plan--insert-gh-item nil)
+
+    (insert "\n** GitHub PRs (assigned)\n")
+    (daily-plan--insert-items .github_assigned_prs #'daily-plan--insert-gh-item nil)))
 
 ;; ── Buffer management ──