Files
werkrevisor/docs/prs/2026-10-23-PR#134-draft-review-open.md
claude-code 4ed2f1d197
werkator build succeeded after 00:13
werkator/werkrevisor-statistics build succeeded after 00:30
werkator/release build succeeded after 00:14
werkrevisor 0.62.0: draft-review --open shows the report in the browser, and the report names and links its PR (#134)
Co-authored-by: claude-code <claude-code@javagil.de>
2026-10-23 12:28:32 +02:00

3.4 KiB

PR#134: draft-review --open Shows the Report in the Browser, and the Report Names and Links Its PR

Version: minor

WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.

  • PR#132: tools/draft-review with a local config and an HTML report.

Problem

After tools/draft-review the human opens report.html by hand, with a path of six directories. The title of the report names only the commit, e.g. "AI review of 6d1842aa", neither the PR nor a link to it.

Non-Goals

  • No change of the review.

Specification

Feature: the report opens in the browser and leads to its PR

Scenario#134.01: --open shows the report in the browser of the local config

… so that the human reads the draft without looking for its path.

  • Given a local config with browser = "brave-browser"
  • When the human runs tools/draft-review 343 --open
  • Then report.html opens in Brave; a browser that does not start leaves the review done and names the path
Verified by

… so that the human sees which PR the draft is about and reaches it with one click.

  • Given a review of PR 343 at commit 6d1842aa
  • When tools/review-report writes the draft
  • Then its title is "AI review of PR#343 (6d1842aa)", PR#343 links the PR in Gitea, and --attach still finds the commit of the draft
Verified by

Scenario#134.03: --open with --attach shows the posted comment

… so that the human checks the posted review right away.

  • Given a checked draft of PR 343
  • When the human runs tools/draft-review 343 --attach --open
  • Then the posted comment opens in the browser; a browser that does not start leaves the comment posted
Verified by

Solution

  • werkrevisor/draftreview.py: --open starts the command of the optional key browser of the local config, or xdg-open, detached; after a review with report.html, after --attach with the URL of the posted comment. Reading the local config checks that browser is a command; a browser that does not start only prints a line, so the review or the posted comment stays done.
  • werkrevisor/reviewreport.py: draft_title writes the PR with its link and the commit in parentheses; attach reads the commit from that title and from the title of older drafts.
  • README.md: the key browser and the option --open.
  • tools/draft-review: only its help text, which names --open and the key browser.