Compare commits

...

7 Commits

Author SHA1 Message Date
Ryan Laurie
bcf67e0b82 ok vibe 2025-11-14 16:16:31 -07:00
Ryan Laurie
d47532cbef try again 2025-11-14 16:13:58 -07:00
Ryan Laurie
28b1345f58 hide old reviews 2025-11-14 16:06:40 -07:00
Ryan Laurie
054fd7851c remove errors 2025-11-14 13:17:51 -07:00
Ryan Laurie
8663108c8a pure vibes 2025-11-05 17:32:24 -07:00
Ryan Laurie
75b79e70df intential whoopsie 2025-11-05 17:24:34 -07:00
Ryan Laurie
e37167b56a fixy wixy 2025-11-05 17:20:42 -07:00

View File

@@ -31,31 +31,30 @@ jobs:
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
# Apparently comments on specific lines and top-level comments about the PR as a whole are TWO TOTALLY DIFFERENT
# TYPES OF THINGS. So we have to fetch and delete separately.
- name: Delete old Claude PR review comments
# Dismiss old reviews from the bot
- name: Dismiss old Claude PR reviews
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
shell: bash
run: |
# Get old comment IDs from the bot
old_line_comment_ids=$(gh api "/repos/$REPO/pulls/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
echo "Deleting line comments: $old_line_comment_ids"
# Delete each comment
for id in $old_line_comment_ids; do
gh api -X DELETE "/repos/$REPO/pulls/comments/$id"
echo "Deleted line comment $id"
done
# Get old top-level comment IDs (technically "issue" comments on the PR?)
old_top_level_comment_ids=$(gh api "/repos/$REPO/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
echo "Deleting top-level comments: $old_top_level_comment_ids"
# Delete each comment
for id in $old_top_level_comment_ids; do
gh api -X DELETE "/repos/$REPO/issues/comments/$id"
echo "Deleted top-level comment $id"
done
# Get old review IDs from the bot that are not dismissed
old_review_ids=$(gh api "/repos/$REPO/pulls/$PR_NUMBER/reviews" \
--jq '.[] | select(.user.login=="metabase-bot[bot]" and .state != "DISMISSED") | .id')
if [ -n "$old_review_ids" ]; then
echo "Dismissing reviews: $old_review_ids"
# Dismiss each review
for review_id in $old_review_ids; do
gh api \
--method PUT \
"/repos/$REPO/pulls/$PR_NUMBER/reviews/$review_id/dismissals" \
-f message="Dismissing outdated review" 2>/dev/null || true
done
else
echo "No reviews to dismiss"
fi
- name: Generate GitHub App Token for Claude
uses: actions/create-github-app-token@v1
@@ -93,9 +92,27 @@ jobs:
Note: The PR branch is already checked out in the current working directory.
Use `gh pr comment` for top-level feedback.
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues.
Only post GitHub comments - don't submit review text as messages.
IMPORTANT: You must create a SINGLE review with all comments batched together. Do NOT create individual comments.
To do this:
1. Use `gh pr diff` and `gh pr view` to gather information about the PR
2. Use ReadFile to review code files as needed
3. Collect ALL your review comments (both inline and general feedback)
4. Create a SINGLE review using the GitHub API with `gh api` that includes:
- A top-level review body with general feedback (if any)
- All inline comments in the "comments" array
- Set "event" to "COMMENT" (not "APPROVE" or "REQUEST_CHANGES")
Example command structure:
```
gh api -X POST "/repos/$REPO/pulls/$PR_NUMBER/reviews" \
-f body="General review feedback here" \
-f event="COMMENT" \
-f comments='[{"path":"file.ts","line":10,"body":"Comment text"}]'
```
For inline comments, you need: path (file path), line (line number), and body (comment text).
For multi-line comments, use: start_line, line (end line), and start_side/side.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),ReadFile(CLOJURE_STYLE_GUIDE.adoc)"
--allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api:*),ReadFile(CLOJURE_STYLE_GUIDE.adoc),ReadFile(*)"