pr view --reviews omits review-comment anchor fields (line/position, diff_hunk, id) #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
What I ran into
Reviewing a PR, I ran
gitea-axi pr view <n> --reviews --fullto read a reviewer's inline comments and answer them.The output tells me the author, the file path, and the comment body, but not which line (or diff position) each comment is attached to, and not the comment's id.
Several comments were things like
"what does this do?"and"Wasn't this set earlier?"— meaningless without knowing the anchored line.I could not answer them from gitea-axi's output alone, so I fell back to a raw
GET /repos/{owner}/{repo}/pulls/{n}/reviews/{id}/commentscall (and hand-parsing the token out of~/.config/tea/config.yml) just to recoverpath+position+diff_hunk.Real gap, not discovery
This is a real gap. The renderer deliberately projects each review comment down to three fields:
The fetched
PullReviewCommentalready carries the rest —diff_hunk,position,original_position, andidare all on the type (node_modules/gitea-js/dist/index.d.mts,interface PullReviewComment) and come back populated fromfetchReviewComments.There is no flag to surface them:
--fullonly toggles body truncation, andpr viewhas no--fieldsfor review-comment sub-fields.So the data is fetched and then dropped on the floor.
Recommendation
Surface the anchor in the
--reviewsoutput for each comment. Minimally add:line(orposition/original_position) — the anchor, so a comment can be tied to code.id— needed to target a specific comment for a reply/resolve/edit later (see the inline-reply and resolve issues).diff_hunk, ideally trimmed to its last 1–2 lines — this alone makes a bare "what does this do?" answerable without a second call, since the hunk tail is the exact code the comment sits on.Keeping it behind the existing
--reviews(and honoring--fullfor the hunk) would have kept this whole task inside gitea-axi.Resolved by task 0034 (commit
b6d247d), now onmain:pr view --reviewssurfaces each inline review comment's anchor fields (line/position, diff_hunk, id).