Skip to content

Fix #759: pr-search includes all PR states so merged PRs are found - #1619

Merged
waleedkadous merged 2 commits into
mainfrom
bugfix/759-pr-search-all-states
Sep 4, 2026
Merged

Fix #759: pr-search includes all PR states so merged PRs are found#1619
waleedkadous merged 2 commits into
mainfrom
bugfix/759-pr-search-all-states

Conversation

@waleedkadous

Copy link
Copy Markdown
Contributor

Clean re-cut of #1331, which was accidentally branched from the Spec 1280 builder branch instead of main and therefore carried ~8.5k lines of unrelated churn around a 60-line fix. Same two commits (fix + regression test), cherry-picked onto current main; nothing else.

Problem

After a PR merges, the post-merge consult --type pr lookup fails with No PR found for branch: … — the same lookup worked pre-merge. One of the roots of the "consult cannot review merged PRs" blocker (#1531).

Root cause

The forge pr-search scripts call gh pr list --search … / glab mr list --search … with no state flag; both CLIs default to open-only, so merged PRs vanish from the search.

Fix

--state all (GitHub) and --all (GitLab) in the two pr-search.sh scripts, each with a comment citing #759.

Testing

bugfix-759-pr-search-state-all.test.ts: both scripts fetch all states; both still pass the search query through. 3 files, +60/−2.

Fixes#759. Supersedes #1331.

🤖 Generated with Claude Code

… found
gh pr list / glab mr list default to open-only; post-merge consult --type pr
lookups returned nothing. Add --state all (github) / --all (gitlab), mirroring
the pr-exists precedent (#568).
@waleedkadous
waleedkadous merged commit 80cbc4c into mainSep 4, 2026
11 of 12 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

forge: github pr-search.sh defaults to open PRs only; post-merge consult fails to find merged PRs

1 participant

@waleedkadous