forge pr list: filter by state and mark merged pull requests #201
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!201
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/forge-pr-list-state"
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?
forge pr listcan now list closed or all pull requests with-s closedor-s all, and in those listings each row ends with a status column:open,closed, ormergedwith the merge date, so a pull request that was closed without merging is never read as evidence that something landed.forge pr viewadds aMerged:line for a merged pull request, and its--jsonfields gainmergedandmergedAt. The defaultforge pr listoutput is unchanged and its existing test still pins it;pr snapshotis untouched. This is what the weekly groom needs to find the pull request that settled an issue without walking every number the repository ever issued. If this is wrong, revert the one commit.Master has since gained the two --json commits this branch was built on, rebase-merged under new hashes, so the branch conflicted. The forge refuses force-pushes on agent branches, so the branch instead merges master; the merge commit's tree is identical to the branch rebased onto master, and the diff against master is the single feature commit.
Closes allod/tools#193
Risk
R1. Additive flags and one optional header line; the default request and row format are unchanged and pinned by the existing tests. Rollback is a revert.
The status cell trusts the API's
mergedboolean andmerged_attimestamp, which Forgejo always carries for a pull request; a merged pull request that somehow arrived without a timestamp would showmergedalone.pr snapshotdeliberately does not gain a merged field: it is a versioned schema consumed by another tool, and nothing needs it yet.Validation
nix build .#checks.x86_64-linux.go-checkspasses on the final tree (gofmt, vet,go testacross all tag sets).cmd/forge/read_test.gopin:-s closedsendsstate=closed, rendersmerged 2026-09-10for a merged andclosedfor an abandoned pull request;-s allrendersopen;-L 5changes the request; the closed and all empty messages;-s bogusand-L 0fail with the issue-list wording; theMerged:line appears for a merged pull request and not for an open one;pr view --json merged,mergedAt.mergedalone, and inferring merged frommerged_atwhen the boolean is absent.