forge pr list: filter by state and mark merged pull requests #201

Merged
vnprc merged 4 commits from agent/forge-pr-list-state into master 2026-09-11 20:23:05 +01:00
Member

forge pr list can now list closed or all pull requests with -s closed or -s all, and in those listings each row ends with a status column: open, closed, or merged with the merge date, so a pull request that was closed without merging is never read as evidence that something landed. forge pr view adds a Merged: line for a merged pull request, and its --json fields gain merged and mergedAt. The default forge pr list output is unchanged and its existing test still pins it; pr snapshot is 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 merged boolean and merged_at timestamp, which Forgejo always carries for a pull request; a merged pull request that somehow arrived without a timestamp would show merged alone. pr snapshot deliberately 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-checks passes on the final tree (gofmt, vet, go test across all tag sets).
  • New tests in cmd/forge/read_test.go pin: -s closed sends state=closed, renders merged 2026-09-10 for a merged and closed for an abandoned pull request; -s all renders open; -L 5 changes the request; the closed and all empty messages; -s bogus and -L 0 fail with the issue-list wording; the Merged: line appears for a merged pull request and not for an open one; pr view --json merged,mergedAt.
  • Two reviewers from other model families read the diff cold. Fixed: one sentence in the docs that called the status column "the only place" merged and abandoned are told apart, which the same change made untrue. Discarded as design: rendering a merged pull request without a timestamp as merged alone, and inferring merged from merged_at when the boolean is absent.
`forge pr list` can now list closed or all pull requests with `-s closed` or `-s all`, and in those listings each row ends with a status column: `open`, `closed`, or `merged` with the merge date, so a pull request that was closed without merging is never read as evidence that something landed. `forge pr view` adds a `Merged:` line for a merged pull request, and its `--json` fields gain `merged` and `mergedAt`. The default `forge pr list` output is unchanged and its existing test still pins it; `pr snapshot` is 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 `merged` boolean and `merged_at` timestamp, which Forgejo always carries for a pull request; a merged pull request that somehow arrived without a timestamp would show `merged` alone. `pr snapshot` deliberately 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-checks` passes on the final tree (gofmt, vet, `go test` across all tag sets). - New tests in `cmd/forge/read_test.go` pin: `-s closed` sends `state=closed`, renders `merged 2026-09-10` for a merged and `closed` for an abandoned pull request; `-s all` renders `open`; `-L 5` changes the request; the closed and all empty messages; `-s bogus` and `-L 0` fail with the issue-list wording; the `Merged:` line appears for a merged pull request and not for an open one; `pr view --json merged,mergedAt`. - Two reviewers from other model families read the diff cold. Fixed: one sentence in the docs that called the status column "the only place" merged and abandoned are told apart, which the same change made untrue. Discarded as design: rendering a merged pull request without a timestamp as `merged` alone, and inferring merged from `merged_at` when the boolean is absent.
Refs allod/tools#193
vnprc approved these changes 2026-09-11 20:13:33 +01:00
Dismissed
vnprc approved these changes 2026-09-11 20:22:59 +01:00
vnprc merged commit 1ff979dcfd into master 2026-09-11 20:23:05 +01:00
vnprc deleted branch agent/forge-pr-list-state 2026-09-11 20:23:05 +01:00
Sign in to join this conversation.
No description provided.