feat(forge): pr review posts a review with inline comments #121
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!121
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/pr-review"
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?
Why
Reviews on git.magicbean.dev had no command: posting one with comments on lines meant hand-writing calls to Forgejo's API, so agents and people tended to put everything in one plain comment.
forge.py pr reviewposts a real review (approve, comment or request changes) with its comments beside the lines they're about.What changed
cmd_pr_review()inscripts/forge.py,pr review N (--approve | --comment | --request-changes) [--body TEXT | --body-file F] [--inline F.json] [--at PATH:LINE TEXT].... It posts one review toPOST /repos/MagicBeanDev/Longshot/pulls/N/reviews, tied to the PR's head commit (commit_id), so a later push marks its comments outdated.--at PATH:LINE TEXT(repeatable) comments on line LINE of the PR's version of the file;PATH:-LINEon a line the PR removes.--inline Ftakes a JSON list of{"path", "line" | "old_line", "body"}. Both can be used together.diff_lines()reads the PR's.diff(hunks, context included; new, deleted and renamed files), andcheck_inline()refuses a line outside the hunks before anything is posted, since Forgejo would put that comment on no line.docs/forge.md, and the command in its list and inforge.py's own help.tests/test_forge_pr.pygets the stand-in Forgejo's review POST and four tests: the diff parser (including---/+++lines inside a hunk, a new file and a deleted one), an approval with four inline comments from both options, lines off the diff and malformed input refused with nothing posted, and the WIP/empty/closed cases.Flags and settings
None.
Measurements
main:
316f9319(2026-11-13)this PR: feat/pr-review @
871ffc34Hardware: Linux (CachyOS), Python 3; no GPU involved
Scene: none: a command-line tool, nothing in the game
Method:
tests/test_forge_pr.py(offline, against the stand-in Forgejo);diff_lines()run on the real diffs of #107 and #108 against the lines the reviews posted there by hand landed on;python -I -B tests/run_all.pyHow to reproduce:
python -I -B tests/test_forge_pr.py;python -I scripts/forge.py pr review --help316f9319871ffc34forge.py pr reviewtests/test_forge_pr.pydiff_lines()on #108:gpu/vk/vk_temporal.cpp:1011,tests/test_psychov35_dlss.py:131(where review 1083 landed)diff_lines()on #107:texture_pass.cpp:450,vk_draw.cpp:3598(review 1082);vk_draw.cpp:3000(not in the diff)Testing
Tested:
tests/test_forge_pr.pyon Linux: 24 of 24 pass.python -I -B tests/run_all.pyon Linux: 460 passed, 7 failed, 69 skipped. The 7 fail onmainon this PC too (its environment):test_bake_portability,test_builder_log_read_only,test_program_cache_cleanup,test_control,test_longshot_ctl,test_program_cache_one_variant,test_vram_budget_row.Not tested:
forge.api(), withold_positionandcommit_idadded; the first real review with it will show it.Needs other testers:
None
Screenshots
Nothing on screen.
Risk and rollback
Only
pr reviewis new; the other commands are untouched. Reverting the commit removes it.Reviewer notes
Start at
cmd_pr_review()anddiff_lines()inscripts/forge.py. Not done on purpose: showing reviews' inline comments inpr view --comments(a follow-up), and a pending (draft) review to add to later.Issues
None.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Description: Needs other testers is a plain None (the check didn't read 'None: ...' as none), and the If applicable box for the check under tests/ that reads forge.py (test_forge_pr.py) is in. No rebase needed: the branch is on main's head,
316f9319; Forgejo shows a WIP PR as not mergeable.WIP: feat(forge): pr review posts a review with inline commentsto feat(forge): pr review posts a review with inline comments