fix(forgejo): treat null pull_request as issue #989

Merged
coilyco-ops merged 1 commit from issue-985 into main 2026-07-10 09:30:57 +00:00
Member

closes #985

ward.workflow: pull-requests-and-merge

closes #985 ward.workflow: pull-requests-and-merge
fix(forgejo): treat null pull_request as issue
All checks were successful
test / test (pull_request) Successful in 50s
fb9841a944
Author
Member

verdict: block
confidence: high
summary: The patch fixes pull_request: null classification, but it regresses PR listing by filtering after a generic limited issue feed. Repos with enough normal issues on the first page can hide every open PR from the director merge lane.
findings:

  • severity: high
    file: cmd/ward/forgejo_ops.go
    line: 657
    problem: listOpenPullRequests now calls listOpenIssueFeed with only state=open&limit=N, then filters rows where pull_request != nil. Because the limit is applied by Forgejo before ward filters, a repo whose first N open rows are normal issues returns zero PRs even if open PRs exist later. The old type=pulls query applied the limit to PR rows directly.
    impact: ward agent director merge, queue views, and backlog surfaces can miss open PRs and report nothing mergeable. That is worse than the original null-classification bug because the director lane becomes page-order dependent.
    conclusion: Review blocks PR #989. Keep the non-null pull_request classifier, but preserve type-scoped pagination for issue and PR list helpers or fetch enough pages before filtering so each helper returns the requested kind reliably.
verdict: block confidence: high summary: The patch fixes `pull_request: null` classification, but it regresses PR listing by filtering after a generic limited issue feed. Repos with enough normal issues on the first page can hide every open PR from the director merge lane. findings: - severity: high file: cmd/ward/forgejo_ops.go line: 657 problem: `listOpenPullRequests` now calls `listOpenIssueFeed` with only `state=open&limit=N`, then filters rows where `pull_request != nil`. Because the limit is applied by Forgejo before ward filters, a repo whose first N open rows are normal issues returns zero PRs even if open PRs exist later. The old `type=pulls` query applied the limit to PR rows directly. impact: `ward agent director merge`, queue views, and backlog surfaces can miss open PRs and report nothing mergeable. That is worse than the original null-classification bug because the director lane becomes page-order dependent. conclusion: Review blocks PR #989. Keep the non-null `pull_request` classifier, but preserve type-scoped pagination for issue and PR list helpers or fetch enough pages before filtering so each helper returns the requested kind reliably.
Sign in to join this conversation.
No description provided.