Skip to content

resolver: add branch-relative non-open PR lookup beside current_pr()#457

Merged
barrettruth merged 1 commit intomainfrom
feature/branch-relative-pr-resolver
Apr 27, 2026
Merged

resolver: add branch-relative non-open PR lookup beside current_pr()#457
barrettruth merged 1 commit intomainfrom
feature/branch-relative-pr-resolver

Conversation

@barrettruth
Copy link
Copy Markdown
Owner

Problem

current_pr() is intentionally open-only, but Forge did not have a second branch-relative PR resolver for workflows that need to recover a unique PR for the current branch across non-open states. That blocked follow-up features like implicit pr reopen and broader implicit pr_ci() fallback without muddying the open-only semantics used by pr(), review(), and create-PR duplicate detection.

Solution

Add require('forge.resolve').branch_pr() with ordered state-search passes, and keep current_pr() as a thin open-only wrapper on top of it. Extend backend branch lookup commands so GitHub, GitLab, and Codeberg can enumerate branch PR candidates under broader state policies, normalize fetched PR detail state so merged PRs stay distinct from merely closed ones, and add resolver/source specs that cover open-only preservation, fallback policy ordering, ambiguity, and backend-specific matching behavior.

Closes #453.

@barrettruth barrettruth merged commit ae44576 into main Apr 27, 2026
3 checks passed
@barrettruth barrettruth deleted the feature/branch-relative-pr-resolver branch April 27, 2026 17:39
Sign up for free to 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.

resolver: add branch-relative non-open PR lookup beside current_pr()

1 participant