Skip to content

feat(review): review GitHub pull requests, plannotator-tui review <PR> - #164

Merged
backnotprop merged 1 commit into
mainfrom
feat/pr-review
Nov 20, 2026
Merged

backnotprop merged 1 commit into
mainfrom
feat/pr-review

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

What it does

plannotator-tui review can now review a GitHub pull request. The screen shows the diff GitHub shows: the PR's head commit against the merge base with its base branch. Notes, Send, reload and the archive work the same as in any other code review. Nothing is posted to GitHub.

The header names the PR, for example:

PR #158 · feat(review): code review from Rex and herdr-cor… · main ← feat/rex-hc-review · 14 files +676 −108

The text sent to the agent uses the browser's PR review header: # PR Review: owner/repo#123, then the title, the branches and the link. Notes are saved once per PR, so you see the same notes from any clone. The archive records the PR in gitRef and pr, as the browser does.

Send works as #159 made it: with no agent target and no delivery command, Send asks which agent to send to.

Accepted forms

  • plannotator-tui review 123: PR 123 of the GitHub repository of the current folder
  • plannotator-tui review '#123': same as above
  • plannotator-tui review https://github.com/owner/repo/pull/123: works from any folder. Anything after the number (/files, ?w=1, #diff…) is ignored.
  • plannotator-tui review --pr X: X is any of the forms above
  • The launchers take the same argument: plannotator-tui herdr review <PR>, rex review <PR>, hc review <PR>

To review a folder whose name is only digits, write ./123.

Where it fetches

It reads the PR with gh pr view (the person's own gh login; this is the only gh call, and it only reads).

  • Inside a clone of the PR's repository (any remote that names it): the PR's commits are fetched into that clone as the private ref refs/plannotator-tui/pull/<n>/head. Your branch, index and working files are not changed.
  • Anywhere else: they are fetched into a bare cache repository under the data folder, at clients/plannotator-tui/pulls/<host>/<owner>/<repo>.git. The first review of a repository downloads its history once.

r reads the PR again and fetches new pushes. Notes follow their lines, the same as for local changes.

How it was tested

  • cargo fmt --check, cargo clippy --locked --workspace --all-targets -- -D warnings and cargo test --locked --workspace pass on macOS.
  • cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets -- -D warnings passes, run as a check-only cross build. The new tests that use a shell-script gh or fake herdr are Unix-only, like the existing Herdr tests.
  • The tests use a simulated GitHub: a local bare repository with refs/pull/7/head, a shell script in place of gh, and url.<path>.insteadOf. No network. They cover link and number parsing, remote matching, capture into a clone and into the cache, reload after a new push, the feedback text and archive fields, the binary through review <PR> and herdr review --pr, and a new screen test: a PR review with no target opens the agent picker on Send and sends the PR feedback to the agent you pick.
  • Real run against feat(review): code review from Rex and herdr-core #158, with a scratch HOME and data dir, in a private tmux server:
    • review 158 in a clone: the header is as shown above, and Send with a delivery command delivered the # PR Review: plannotator/plannotator-tui#158 text.
    • review '#158' in the clone with no delivery command and no agent target, and a fake herdr that lists one agent: the header reads Send 1 new ▸ choose agent (E). Send opened "send to which agent?" with Copy to clipboard and the agent, with the cursor on the agent. Esc said "nothing sent". A second Send, then Enter, sent the PR feedback to the fake agent's pane.
    • review https://github.com/plannotator/plannotator-tui/pull/158 from a folder that is not a clone: fetched into the cache repository and showed the same header.

@backnotprop
backnotprop added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@backnotprop
backnotprop added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 6afb22f Nov 20, 2026
3 checks passed
@backnotprop
backnotprop deleted the feat/pr-review branch November 20, 2026 00:50
@backnotprop backnotprop mentioned this pull request Nov 23, 2026
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.

1 participant