fix(review-pr): anchor findings to diff lines
The gitea posting snippet used the issue-comment endpoint, which has no path or line, so findings named `path:line` in prose instead of landing on the code. Both forges now post one COMMENT review carrying anchored findings in comments[] and loose ones in the body. land's gitea baseline missed review-comment ids, which would replay every code comment on the first hint. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
-3
@@ -61,9 +61,11 @@ fi
|
||||
Gitea equivalent — issue comments plus reviews:
|
||||
|
||||
```bash
|
||||
{ curl -sS -H "Authorization: token $GITEA_TOKEN" "$BASE/api/v1/repos/$REPO/issues/$N/comments"; \
|
||||
curl -sS -H "Authorization: token $GITEA_TOKEN" "$BASE/api/v1/repos/$REPO/pulls/$N/reviews"; } 2>/dev/null \
|
||||
| jq -r '.[]?.id' > "$seen" || : > "$seen"
|
||||
{ curl -sS -H "Authorization: token $GITEA_TOKEN" "$BASE/api/v1/repos/$REPO/issues/$N/comments" | jq -r '.[]?.id'
|
||||
for r in $(curl -sS -H "Authorization: token $GITEA_TOKEN" "$BASE/api/v1/repos/$REPO/pulls/$N/reviews" | jq -r '.[]?.id'); do
|
||||
echo "$r"
|
||||
curl -sS -H "Authorization: token $GITEA_TOKEN" "$BASE/api/v1/repos/$REPO/pulls/$N/reviews/$r/comments" | jq -r '.[]?.id'
|
||||
done; } 2>/dev/null > "$seen" || : > "$seen"
|
||||
```
|
||||
|
||||
**Request the Copilot review** (github only, once). Its comments then
|
||||
@@ -111,6 +113,12 @@ and act on what's left:
|
||||
echo "$rid" >> "$seen"
|
||||
```
|
||||
|
||||
Gitea has no reply endpoint, so that lands as a loose PR comment. To
|
||||
answer a code comment inside its own thread, post a review instead
|
||||
whose `comments[]` entry repeats the same `path` and `new_position` —
|
||||
gitea groups code comments by position into one conversation. Record
|
||||
the review id and its comment ids.
|
||||
|
||||
- **Resolve the thread** (github only — gitea has no per-thread
|
||||
resolve, so a short confirming reply plus the pushed fix is the
|
||||
signal):
|
||||
|
||||
Reference in New Issue
Block a user