[nixos-configs-vru] Add skill for responding to Gitea PR review comments #26
@@ -21,7 +21,7 @@ When a reviewer leaves a comment, they're identifying something that needs atten
|
|||||||
- `tea` CLI configured with a Gitea/Forgejo instance
|
- `tea` CLI configured with a Gitea/Forgejo instance
|
||||||
- Access token from tea config: `~/.config/tea/config.yml`
|
- Access token from tea config: `~/.config/tea/config.yml`
|
||||||
- Repository must be a Gitea/Forgejo remote (not GitHub)
|
- Repository must be a Gitea/Forgejo remote (not GitHub)
|
||||||
- **Nix users**: All tools available via nixpkgs (`nix-shell -p tea`)
|
- **Nix users**: All tools available via nixpkgs (`nix run nixpkgs#tea`)
|
||||||
|
|
||||||
## Initial Setup
|
## Initial Setup
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ When this command is invoked:
|
|||||||
Error: `tea` CLI not found.
|
Error: `tea` CLI not found.
|
||||||
|
|
||||||
Please install:
|
Please install:
|
||||||
- Nix: nix-shell -p tea
|
- Nix: nix run nixpkgs#tea
|
||||||
- Other: https://gitea.com/gitea/tea
|
- Other: https://gitea.com/gitea/tea
|
||||||
```
|
```
|
||||||
**STOP** if tea is missing.
|
**STOP** if tea is missing.
|
||||||
@@ -113,18 +113,26 @@ Would you like to:
|
|||||||
Fetch all reviews and their comments:
|
Fetch all reviews and their comments:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Fetch reviews
|
# Fetch reviews (filter out dismissed reviews)
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
curl -s -H "Authorization: token $TOKEN" \
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews"
|
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews" \
|
||||||
|
| jq '[.[] | select(.dismissed != true)]'
|
||||||
|
|
||||||
# For each review, fetch comments
|
# For each review, fetch comments
|
||||||
curl -s -H "Authorization: token $TOKEN" \
|
curl -s -H "Authorization: token $TOKEN" \
|
||||||
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments"
|
"$GITEA_URL/api/v1/repos/$OWNER/$REPO/pulls/$PR_NUMBER/reviews/$REVIEW_ID/comments"
|
||||||
```
|
```
|
||||||
|
|
||||||
If no reviews found:
|
**Filter resolved comments**: When processing comments, skip any that have been marked as resolved. Check the `resolver` field in the comment response - if it's not null, the comment has been resolved and should be skipped.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example: Filter to only unresolved comments
|
||||||
|
jq '[.[] | select(.resolver == null)]'
|
||||||
```
|
```
|
||||||
No reviews found for PR #{PR_NUMBER}.
|
|
||||||
|
If no reviews found or all comments are resolved:
|
||||||
|
```
|
||||||
|
No unresolved reviews found for PR #{PR_NUMBER}.
|
||||||
Nothing to address.
|
Nothing to address.
|
||||||
```
|
```
|
||||||
**STOP** here.
|
**STOP** here.
|
||||||
@@ -251,6 +259,8 @@ Post a single comment summarizing all actions taken:
|
|||||||
tea comment $PR_NUMBER "$(cat <<'EOF'
|
tea comment $PR_NUMBER "$(cat <<'EOF'
|
||||||
## Review Comments Addressed
|
## Review Comments Addressed
|
||||||
|
|
||||||
|
cc @{reviewer1} @{reviewer2}
|
||||||
|
|
||||||
**Changes made** (commit {SHORT_SHA}):
|
**Changes made** (commit {SHORT_SHA}):
|
||||||
- `{file1}:{line}`: {what_was_changed}
|
- `{file1}:{line}`: {what_was_changed}
|
||||||
- `{file2}:{line}`: {what_was_changed}
|
- `{file2}:{line}`: {what_was_changed}
|
||||||
@@ -282,11 +292,14 @@ Display to user:
|
|||||||
- [x] {file2}:{line} - Explained CI approach in comment
|
- [x] {file2}:{line} - Explained CI approach in comment
|
||||||
- [ ] {file3}:{line} - Acknowledged (separate skill)
|
- [ ] {file3}:{line} - Acknowledged (separate skill)
|
||||||
|
|
||||||
|
**Reviewers tagged**: @{reviewer1}, @{reviewer2}
|
||||||
**Comment posted**: {comment_url}
|
**Comment posted**: {comment_url}
|
||||||
|
|
||||||
PR URL: {GITEA_URL}/{OWNER}/{REPO}/pulls/{PR_NUMBER}
|
PR URL: {GITEA_URL}/{OWNER}/{REPO}/pulls/{PR_NUMBER}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note**: When posting the summary comment, tag all reviewers who left comments so they receive notifications about the changes.
|
||||||
|
|
||||||
## Error Handling
|
## Error Handling
|
||||||
|
|
||||||
### Subagent failed to make change
|
### Subagent failed to make change
|
||||||
|
|||||||
Reference in New Issue
Block a user