forge-notify: show unseen inline review comments in PR wakes
This commit is contained in:
parent
ff3d119c63
commit
6494c5d7f4
1 changed files with 315 additions and 33 deletions
|
|
@ -298,6 +298,25 @@ A review submitted with **no body** renders `reviewed by: <author>` in
|
|||
place of the `<author>: <body>` line — deliberately worded to not collide
|
||||
with the meta-suffix `reviewer:` line (requested reviewers, below).
|
||||
|
||||
### Inline review comments
|
||||
|
||||
A review's line comments belong to neither the review body nor the
|
||||
`latest_comment_url` (a review with only inline comments has no such url
|
||||
and otherwise lands as a bare `activity on PR`). So every PR wake fetches
|
||||
the PR's reviews (`/pulls/N/reviews`, up to four pages of 50) and appends
|
||||
the inline comments of those that are new to the agent as an
|
||||
`inline review comments:` block, one `author [path:line]: text` entry
|
||||
each (`[path]` when Forgejo dropped the position because the line left the
|
||||
diff). A review counts as new when it was submitted strictly after the
|
||||
thread's previously delivered `updated_at` (all of them without a
|
||||
baseline, and any with no submit time, so nothing is hidden), is not the
|
||||
agent's own, is not a `PENDING` draft, and has `comments_count > 0`. Only
|
||||
the newest 5 such reviews are fetched, at most 10 comments are shown
|
||||
(`(+N more ...)` for the rest), and each excerpt is truncated to 300 bytes
|
||||
and heading-escaped like a body. Best effort: a failed fetch yields less
|
||||
text, never a dropped wake. Cost: one reviews fetch per PR wake, plus one
|
||||
per new commented review.
|
||||
|
||||
### Merge/close vs a later comment
|
||||
|
||||
A notification carrying a `latest_comment_url` normally takes the comment
|
||||
|
|
|
|||
Loading…
Reference in a new issue