phase-pr can ask the forge which pull request is on this branch instead of trusting the card #507
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#507
Loading…
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?
phase-pr's duplicate path asks the card which pull request this phase opened. The card is keyed on the issue, so it can hold another phase's url, and #467 added a guard for exactly that — now a branch comparison (PR #506). The guard is correct and it refuses, but a refusal under--batchstops the batch and needs a person.The forge already knows the answer.
createPullRequestreturnedDuplicate, which means a pull request is open onphaseBranchName. Asking the forge which one that is removes the card from the decision entirely: no stale url can be read, no guard can refuse, and the autonomous path never stops for a human.What is missing
A port method that answers "the open pull request whose head branch is X".
ForgejoClient.fetchPullRequestForBranch(core/adapters/ForgejoClient.scala:615), withbuildPullRequestListUrlandparsePullRequestForBranchbeside it. It is not onTrackerOps.gh pr list --head <branch> --json url— no client method yet.glab api projects/:id/merge_requests?source_branch=<branch>— no client method yet.What to do
Promote it to
TrackerOps, implement the two missing clients, and haveresolvePullRequest'sDuplicatebranch ask the forge instead of the card. The card'spr_urlstays what it is — a record for the dashboard — and stops being an input to a merge decision.The branch guard from PR #506 can then go, or stay as a cross-check on a card that disagrees with the forge. That is a decision for the change, not for this issue.
Origin
Recorded while fixing the two review warnings on #467. The guard fixes the false refusal and the misleading remedy; it does not remove the need for a human when the card is genuinely wrong.