api/cmd: let implicit pr_ci resolve closed and merged PRs #450
Labels
No labels
bug
documentation
duplicate
enhancement
fugitive
good first issue
help wanted
invalid
question
v0.1.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/forge.nvim#450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Searched existing issues; the closest related work is #389 and #391.
Problem
Today the implicit current-ref PR CI entrypoints are open-PR-only:
require('forge').pr_ci():Forge pr ciThey resolve through
current_pr(), which currently warnsno open PR found for this branchwhen the current branch has no open match.That behavior is intentional in the current implementation:
resolve_action_pr()routes implicitpr_ci()throughcurrent_pr()current_pr()returnsnilwhen no open PR matchespr_for_branch_cmd()lookups use open-only PR/MR listingThis makes post-merge/post-close CI inspection awkward. If I am still on the branch for a PR that was just merged or closed,
pr_ci()can no longer recover that PR's checks from branch context, even though viewing CI for a closed/merged PR is still useful.Explicit targeting remains possible with
pr_ci({ num = '42' }), but that requires already knowing the PR number.Proposed solution
Revisit the semantics of implicit
pr_ci()/:Forge pr cispecifically.A reasonable behavior would be:
pr()andreview()open-PR-only if that still makes sense for edit/review flowsIn other words: CI inspection may want broader branch->PR resolution than edit/review actions do.
Alternatives considered
num=/{num}for closed or merged PRs. This is precise, but it makes the common "I just merged this, show me its checks again" flow unnecessarily manual.current_pr()globally to include closed/merged PRs. That may be too broad for flows likepr()andreview()that conceptually target open PRs.pr_ci()unchanged. That avoids changing current-ref semantics, but adds another near-duplicate entrypoint.Tracking note: I’m implementing #453 first as the shared resolver/backend layer. This issue should then consume it with open-first, then closed/merged fallback for implicit
pr_ci(), while keepingpr()andreview()open-only.