Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
48 changes: 48 additions & 0 deletions .github/scripts/claude-review-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail

export PATH="/Users/yukeun/.local/bin:$PATH"

REVIEW_FILE="/tmp/claude-review-${PR_NUMBER}.json"

PROMPT_FILE=$(mktemp /tmp/claude-review-prompt.XXXXXX.txt)
trap 'rm -f "$PROMPT_FILE"' EXIT

cat > "$PROMPT_FILE" <<PROMPT_EOF
You are reviewing PR #${PR_NUMBER} in the sandbox-load-test repository.

Steps:
1. Read ALL CLAUDE.md/AGENTS.md files to understand project conventions.
2. Run: git diff origin/${BASE_REF}...HEAD --name-only (get changed files)
3. Run: git diff origin/${BASE_REF}...HEAD (get the full diff with line numbers)
4. Read the changed files to understand context.
5. Write a thorough code review in Korean.

6. Write the review to ${REVIEW_FILE} in this exact JSON format.
The 'body' field must use this exact markdown structure:

{
"body": "## 🤖 eottabom-claude-review\n\n### 📊 종합 평가\n\n| 항목 | 평가 |\n|------|------|\n| ✅ Correctness | <가능 / 불가 + 한 줄 이유> |\n| 🔁 Regression Risk | <🔴 매우 높음 / 🟡 보통 / 🟢 낮음 + 한 줄 이유> |\n| ⚠️ Risky Changes | <있음: 내용 요약 / 없음> |\n| 🧪 Missing Tests | <있음: 내용 요약 / 없음> |\n\n### 📝 상세 리뷰\n\n<상세 리뷰 내용을 마크다운으로 작성. 파일명, 라인, 근거를 구체적으로>",
"event": "COMMENT",
"comments": [
{
"path": "relative/path/to/file.java",
"line": <line number in the new version of the file>,
"side": "RIGHT",
"body": "<specific inline comment in Korean>"
}
]
}

7. Post the review:
gh api /repos/eottabom/sandbox-load-test/pulls/${PR_NUMBER}/reviews --method POST --input ${REVIEW_FILE}

Rules:
- Only add inline comments on lines that exist in the diff (added or changed lines on the RIGHT side).
- The 'line' must be the actual line number in the current file, not the diff position.
- If there are no specific inline findings, use an empty array for 'comments'.
- If there are no findings at all, still post a summary saying so.
- Write everything in Korean.
PROMPT_EOF

claude --dangerously-skip-permissions --verbose --output-format stream-json < "$PROMPT_FILE"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
50 changes: 50 additions & 0 deletions .github/scripts/codex-review-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -euo pipefail

export PATH="/Users/yukeun/.local/bin:$PATH"

REVIEW_FILE="/tmp/codex-review-${PR_NUMBER}.json"

PROMPT_FILE=$(mktemp /tmp/codex-review-prompt.XXXXXX.txt)
trap 'rm -f "$PROMPT_FILE"' EXIT

cat > "$PROMPT_FILE" <<PROMPT_EOF
You are reviewing PR #${PR_NUMBER} in the sandbox-load-test repository.

Steps:
1. Read all AGENTS.md/CLAUDE.md files to understand project conventions.
2. Run: git diff origin/${BASE_REF}...HEAD --name-only (get changed files)
3. Run: git diff origin/${BASE_REF}...HEAD (get the full diff with line numbers)
4. Read the changed files to understand context.
5. Write a thorough code review in Korean.

6. Write the review to ${REVIEW_FILE} in this exact JSON format.
The 'body' field must use this exact markdown structure:
{
"body": "## 🤖 eottabom-codex-review\n\n### 📊 종합 평가\n\n| 항목 | 평가 |\n|------|------|\n| ✅ Correctness | <가능 / 불가 + 한 줄 이유> |\n| 🔁 Regression Risk | <🔴 매우 높음 / 🟡 보통 / 🟢 낮음 + 한 줄 이유> |\n| ⚠️ Risky Changes | <있음: 내용 요약 / 없음> |\n| 🧪 Missing Tests | <있음: 내용 요약 / 없음> |\n\n### 📝 상세 리뷰\n\n<상세 리뷰 내용을 마크다운으로 작성. 파일명, 라인, 근거를 구체적으로>",
"event": "COMMENT",
"comments": [
{
"path": "relative/path/to/file.java",
"line": <line number in the new version of the file>,
"side": "RIGHT",
"body": "<specific inline comment in Korean>"
}
]
}

7. Post the review:
gh api /repos/eottabom/sandbox-load-test/pulls/${PR_NUMBER}/reviews --method POST --input ${REVIEW_FILE}

Rules:
- Only add inline comments on lines that exist in the diff (added or changed lines on the RIGHT side).
- The 'line' must be the actual line number in the current file, not the diff position.
- If there are no specific inline findings, use an empty array for 'comments'.
- If there are no findings at all, still post a summary saying so.
- Write everything in Korean.
PROMPT_EOF

codex exec \
-C "/Users/yukeun/workspace/sandbox-load-test" \
--dangerously-bypass-approvals-and-sandbox \
- < "$PROMPT_FILE"
103 changes: 103 additions & 0 deletions .github/workflows/pr-auto-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: PR Auto Review

on:
pull_request:
types: [opened, ready_for_review]

permissions:
contents: read
pull-requests: write

jobs:
claude-review:
if: github.event.pull_request.draft == false
timeout-minutes: 30
concurrency:
group: claude-review-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: [self-hosted, macOS, X64]
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}

defaults:
run:
working-directory: /Users/yukeun/workspace/sandbox-load-test

steps:
- name: Checkout PR branch
run: |
git remote set-url origin https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/eottabom/sandbox-load-test.git
git fetch origin
git checkout ${{ github.event.pull_request.head.ref }} 2>/dev/null || git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git reset --hard origin/${{ github.event.pull_request.head.ref }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Check Claude login status
id: claude_auth
env:
HOME: /Users/yukeun
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
export PATH="/Users/yukeun/.local/bin:$PATH"
if claude auth status 2>/dev/null | jq -e '.loggedIn == true' >/dev/null; then
echo "logged_in=true" >> "$GITHUB_OUTPUT"
else
echo "logged_in=false" >> "$GITHUB_OUTPUT"
gh pr comment "$PR_NUMBER" --repo eottabom/sandbox-load-test --body "⚠️ **eottabom-bot** self-hosted 러너의 \`claude\` CLI 로그인 세션이 만료되어 자동 리뷰를 실행할 수 없습니다. 러너 머신에서 \`claude /login\`으로 재로그인해 주세요."
fi

- name: Run Claude review
if: steps.claude_auth.outputs.logged_in == 'true'
env:
HOME: /Users/yukeun
CI: ""
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
unset CI
unset GITHUB_ACTIONS
unset GITHUB_TOKEN
bash /Users/yukeun/workspace/sandbox-load-test/.github/scripts/claude-review-run.sh 2>&1 | \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
jq --unbuffered -r '
if .type == "assistant" then
(.message.content // [])[] |
if .type == "text" then .text
elif .type == "tool_use" then "[tool:\(.name)] \(.input | tostring | .[0:200])"
else empty end
elif .type == "tool_result" then
" → \((.content // [])[] | select(.type == "text") | .text | .[0:300])"
elif .type == "result" then
"\n=== \(.subtype) ==="
else empty end
' 2>/dev/null || true

codex-review:
if: github.event.pull_request.draft == false
timeout-minutes: 30
concurrency:
group: codex-review-pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
runs-on: [self-hosted, macOS, X64]
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
BASE_REF: ${{ github.event.pull_request.base.ref }}

defaults:
run:
working-directory: /Users/yukeun/workspace/sandbox-load-test

steps:
- name: Checkout PR branch
run: |
git remote set-url origin https://x-access-token:${{ secrets.BOT_TOKEN }}@github.com/eottabom/sandbox-load-test.git
git fetch origin
git checkout ${{ github.event.pull_request.head.ref }} 2>/dev/null || git checkout -b ${{ github.event.pull_request.head.ref }} origin/${{ github.event.pull_request.head.ref }}
git reset --hard origin/${{ github.event.pull_request.head.ref }}

- name: Run Codex review
env:
HOME: /Users/yukeun
CI: ""
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
unset CI
bash /Users/yukeun/workspace/sandbox-load-test/.github/scripts/codex-review-run.sh
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
Loading