fix(skills): Address PR review comments for gitea_pr_review
- Use `nix run nixpkgs#tea` instead of nix-shell (preferred for ad-hoc) - Add reviewer tagging in summary comment with cc @mentions - Filter out dismissed reviews and resolved comments in workflow - Add note about notifying reviewers of changes
This commit is contained in:
@@ -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
|
||||
- Access token from tea config: `~/.config/tea/config.yml`
|
||||
- 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
|
||||
|
||||
@@ -41,7 +41,7 @@ When this command is invoked:
|
||||
Error: `tea` CLI not found.
|
||||
|
||||
Please install:
|
||||
- Nix: nix-shell -p tea
|
||||
- Nix: nix run nixpkgs#tea
|
||||
- Other: https://gitea.com/gitea/tea
|
||||
```
|
||||
**STOP** if tea is missing.
|
||||
@@ -113,18 +113,26 @@ Would you like to:
|
||||
Fetch all reviews and their comments:
|
||||
|
||||
```bash
|
||||
# Fetch reviews
|
||||
# Fetch reviews (filter out dismissed reviews)
|
||||
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
|
||||
curl -s -H "Authorization: token $TOKEN" \
|
||||
"$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.
|
||||
```
|
||||
**STOP** here.
|
||||
@@ -251,6 +259,8 @@ Post a single comment summarizing all actions taken:
|
||||
tea comment $PR_NUMBER "$(cat <<'EOF'
|
||||
## Review Comments Addressed
|
||||
|
||||
cc @{reviewer1} @{reviewer2}
|
||||
|
||||
**Changes made** (commit {SHORT_SHA}):
|
||||
- `{file1}:{line}`: {what_was_changed}
|
||||
- `{file2}:{line}`: {what_was_changed}
|
||||
@@ -282,11 +292,14 @@ Display to user:
|
||||
- [x] {file2}:{line} - Explained CI approach in comment
|
||||
- [ ] {file3}:{line} - Acknowledged (separate skill)
|
||||
|
||||
**Reviewers tagged**: @{reviewer1}, @{reviewer2}
|
||||
**Comment posted**: {comment_url}
|
||||
|
||||
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
|
||||
|
||||
### Subagent failed to make change
|
||||
|
||||
Reference in New Issue
Block a user