Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0694a96
[test] Add test service with intentional violations
christian-byrne Jul 14, 2025
0f871b5
[fix] Fix TypeScript errors to allow CI to pass
christian-byrne Jul 14, 2025
2271607
[test] Add browser test for TestReviewService
christian-byrne Jul 15, 2025
f8cbd15
[test] Add comment to browser test
christian-byrne Jul 15, 2025
39dc780
[fix] Update CI check names to match actual workflow names
christian-byrne Jul 15, 2025
4e70864
[fix] Fix Claude action configuration
christian-byrne Jul 15, 2025
13b826f
[fix] Fix Claude review execution limits
christian-byrne Jul 15, 2025
931d772
[fix] Allow all bash commands for PR review
christian-byrne Jul 15, 2025
b800104
[fix] Add actual analysis code to review command
christian-byrne Jul 16, 2025
8a806dd
[fix] Clarify Claude should analyze files, not just run bash
christian-byrne Jul 16, 2025
f3e4bb7
[fix] Add explicit instructions for Claude's analysis phase
christian-byrne Jul 16, 2025
187fe67
[fix] Update Claude PR review workflow to fix bash permission issues
christian-byrne Jul 24, 2025
79fe98e
[fix] Update bash permissions configuration to use specific command p…
christian-byrne Jul 24, 2025
19f45c0
Update locales [skip ci]
invalid-email-address Jul 24, 2025
51622eb
[refactor] Simplify Claude PR review workflow to use direct step-by-s…
christian-byrne Jul 24, 2025
4d70abb
[fix] Add inline comment posting to Claude PR review workflow
christian-byrne Jul 24, 2025
a60e7c0
[fix] Update Claude PR review workflow with comprehensive inline prom…
christian-byrne Jul 26, 2025
59b412f
[fix] Use prompt_file and fix inline comment syntax in comprehensive …
christian-byrne Jul 26, 2025
25cd97c
[fix] Fix CI check names in wait-for-ci step to match actual check names
christian-byrne Jul 26, 2025
d4280f9
[fix] Add id-token write permission for OIDC authentication
christian-byrne Jul 26, 2025
976130a
[fix] Use valid action parameters: label_trigger and direct_prompt
christian-byrne Jul 26, 2025
2acc16e
[fix] Make prompt more explicit about using Read tool to access revie…
christian-byrne Jul 26, 2025
a6b7ccb
[fix] Correct inline comment posting in comprehensive PR review
christian-byrne Jul 26, 2025
d9f4df3
[fix] Make bash execution requirement explicit in PR review workflow
christian-byrne Jul 26, 2025
d0deb4c
[refactor] Convert comprehensive review to natural language instructions
christian-byrne Jul 26, 2025
5e2ed16
[fix] Add explicit permissions instructions to comprehensive review
christian-byrne Jul 27, 2025
1df08d0
[fix] Convert gh api commands to single-line format
christian-byrne Jul 27, 2025
1677513
[feat] Add comprehensive PR review workflow with inline comments
christian-byrne Jul 27, 2025
ee42add
[feat] Update comprehensive PR review with natural language instructions
christian-byrne Jul 28, 2025
34dee8f
remove logs file
christian-byrne Jul 29, 2025
b82e0d7
remove test code [skip ci]
christian-byrne Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .claude/commands/comprehensive-pr-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,14 @@ After all inline comments, create a detailed summary:
# Initialize metrics tracking
REVIEW_START_TIME=$(date +%s)

# Debug: Show what we're about to post
echo "About to post review summary with:"
echo "- Critical: $CRITICAL_COUNT"
echo "- High: $HIGH_COUNT"
echo "- Medium: $MEDIUM_COUNT"
echo "- Low: $LOW_COUNT"
echo "- Total issues: $((CRITICAL_COUNT + HIGH_COUNT + MEDIUM_COUNT + LOW_COUNT))"

# Create the comprehensive summary
gh pr review $PR_NUMBER --comment --body "# Comprehensive PR Review

Expand Down
80 changes: 75 additions & 5 deletions .github/workflows/claude-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ permissions:
contents: read
pull-requests: write
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Security] Medium Priority

Issue: Broad permissions granted to workflow that may not all be necessary
Context: The workflow has write permissions for contents, issues, statuses which increases attack surface if compromised
Suggestion: Follow principle of least privilege - only grant the minimum permissions needed (pull-requests: write and contents: read appear sufficient)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Security] Medium Priority

Issue: Broad permissions granted to workflow that may not all be necessary
Context: The workflow has write permissions for contents, issues, statuses which increases attack surface if compromised
Suggestion: Follow principle of least privilege - only grant the minimum permissions needed (pull-requests: write and contents: read appear sufficient)

issues: write
id-token: write

on:
pull_request:
Expand All @@ -20,15 +21,15 @@ jobs:
uses: lewagon/wait-on-check-action@v1.3.1
with:
ref: ${{ github.event.pull_request.head.sha }}
check-regexp: '^(ESLint|Prettier Check|Tests CI|Vitest Tests)'
check-regexp: '^(eslint|prettier|test)'
wait-interval: 30
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check if we should proceed
id: check-status
run: |
# Get all check runs for this commit
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("ESLint|Prettier Check|Tests CI|Vitest Tests")) | {name, conclusion}')
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("eslint|prettier|test")) | {name, conclusion}')

# Check if any required checks failed
if echo "$CHECK_RUNS" | grep -q '"conclusion": "failure"'; then
Expand Down Expand Up @@ -61,12 +62,81 @@ jobs:
npm install -g typescript @vue/compiler-sfc

- name: Run Claude PR Review
uses: anthropics/claude-code-action@main
uses: anthropics/claude-code-base-action@beta
with:
prompt_file: .claude/commands/comprehensive-pr-review.md
prompt: |
You are performing a code review for PR #${{ github.event.pull_request.number }} in the ComfyUI_frontend repository.

STEP 1: Get PR information and changed files
Execute this bash command:
```bash
gh pr view $PR_NUMBER --json files,title,body,additions,deletions --jq '.files[].filename' > changed_files.txt
echo "Changed files:"
cat changed_files.txt
```

STEP 2: Analyze each changed file
For each file in changed_files.txt:
- Read the file using the Read tool
- Look for these issues:
* Security vulnerabilities (hardcoded secrets, SQL injection, XSS)
* Performance problems (console.log statements, inefficient code)
* Code quality issues (missing error handling, deprecated patterns)
* Architecture violations (improper component structure)

STEP 3: Post individual inline review comments
For each issue found, post an inline comment using this bash function:
```bash
add_inline_comment() {
local file_path=$1
local line_number=$2
local severity=$3
local category=$4
local issue=$5
local suggestion=$6

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/$REPOSITORY/pulls/$PR_NUMBER/comments \
-f body="**[$category] $severity Priority**

**Issue**: $issue
**Suggestion**: $suggestion

This review is generated by Claude." \
-f commit_id="$COMMIT_SHA" \
-f path="$file_path" \
-F line=$line_number \
-f side="RIGHT"
}

# Example usage:
# add_inline_comment "src/services/testReviewService.ts" 15 "Critical" "Security" "Hardcoded API key" "Use environment variables instead"
```

STEP 4: Post final summary review
After posting all inline comments, create a summary:
```bash
gh pr review $PR_NUMBER --comment --body "# 🤖 Claude PR Review Summary

**Issues Found**: [X total]
- Critical: [X]
- High: [X]
- Medium: [X]
- Low: [X]

See individual inline comments above for specific issues and suggestions.

This review is generated by Claude. It may not always be accurate. Please verify suggestions before implementing."
```

The environment variables PR_NUMBER, GITHUB_TOKEN, COMMIT_SHA, and REPOSITORY are already set.
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
max_turns: 1
max_turns: 30
timeout_minutes: 30
allowed_tools: "Bash(git:*),Bash(gh:*),Bash(jq:*),Bash(curl:*),Bash(echo:*),Bash(mkdir:*),Bash(mv:*),Bash(cp:*),Bash(find:*),Bash(cat:*),Bash(wc:*),Bash(awk:*),Bash(date:*),Bash(export:*),Read,Write,Edit,Glob,Grep,WebFetch"
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions browser_tests/tests/interaction.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { expect } from '@playwright/test'
import { Position } from '@vueuse/core'

// Test update for PR review validation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Quality] Low Priority

Issue: Test comment lacks specific purpose or context
Context: Generic comments like ''Test update for PR review validation'' don''t provide value and may be forgotten
Suggestion: Either remove the comment or provide specific context about what validation is being performed

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Quality] Low Priority

Issue: Test comment lacks specific purpose or context
Context: Generic comments like ''Test update for PR review validation'' don''t provide value and may be forgotten
Suggestion: Either remove the comment or provide specific context about what validation is being performed


import {
type ComfyPage,
comfyPageFixture as test,
Expand Down
4 changes: 0 additions & 4 deletions src/locales/zh-TW/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,6 @@
},
"tooltip": "選單列位置。在行動裝置上,選單永遠顯示在頂部。"
},
"Comfy_Validation_NodeDefs": {
"name": "驗證節點定義(較慢)",
"tooltip": "建議節點開發者使用。這會在啟動時驗證所有節點定義。"
},
"Comfy_Validation_Workflows": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Quality] Medium Priority

Issue: Translation key removed without verification of usage in codebase
Context: The ''Comfy_Validation_NodeDefs'' translation key was removed but may still be referenced elsewhere causing missing translation errors
Suggestion: Before removing translation keys, search codebase to ensure no references remain, or use deprecation warnings first

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Quality] Medium Priority

Issue: Translation key removed without verification of usage in codebase
Context: The ''Comfy_Validation_NodeDefs'' translation key was removed but may still be referenced elsewhere causing missing translation errors
Suggestion: Before removing translation keys, search codebase to ensure no references remain, or use deprecation warnings first

"name": "驗證工作流程"
},
Expand Down
Loading
Loading