Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions internal/github/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,20 @@ func (p *PRInfo) StatusDescription() string {
}

// ghPRListResponse is a single PR from gh pr list.
// statusCheckRollup is intentionally omitted from the batch path — it forces
// GraphQL to expand every check run per PR, blowing up cost. The per-task
// detail fetch (fetchPRInfo) still pulls it for the selected task.
type ghPRListResponse struct {
Number int `json:"number"`
URL string `json:"url"`
State string `json:"state"`
IsDraft bool `json:"isDraft"`
Title string `json:"title"`
HeadRefName string `json:"headRefName"`
Mergeable string `json:"mergeable"`
StatusCheckRollup []ghCheck `json:"statusCheckRollup"`
UpdatedAt string `json:"updatedAt"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Number int `json:"number"`
URL string `json:"url"`
State string `json:"state"`
IsDraft bool `json:"isDraft"`
Title string `json:"title"`
HeadRefName string `json:"headRefName"`
Mergeable string `json:"mergeable"`
UpdatedAt string `json:"updatedAt"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
}

// graphQLRateLimitRemaining returns the remaining GraphQL rate limit budget.
Expand Down Expand Up @@ -359,7 +361,7 @@ func FetchAllPRsForRepo(repoDir string) map[string]*PRInfo {
// Get all open PRs in one call
cmd := exec.CommandContext(ctx, "gh", "pr", "list",
"--state", "open",
"--json", "number,url,state,isDraft,title,headRefName,mergeable,statusCheckRollup,updatedAt,additions,deletions",
"--json", "number,url,state,isDraft,title,headRefName,mergeable,updatedAt,additions,deletions",
"--limit", "100")
cmd.Dir = repoDir

Expand Down Expand Up @@ -447,8 +449,9 @@ func parsePRListResponse(pr *ghPRListResponse) *PRInfo {
info.State = PRStateOpen
}

// Parse check state
info.CheckState = parseCheckState(pr.StatusCheckRollup)
// CheckState left as CheckStateNone — the batch query no longer fetches
// statusCheckRollup. The per-task detail fetch in GetPRForBranch fills it
// in when a task is selected.

// Parse updated time
if t, err := time.Parse(time.RFC3339, pr.UpdatedAt); err == nil {
Expand Down
Loading