C.W.K.
Stream
Lesson 08 of 11 · published

코드 리뷰 워크플로우

~14 min · codex, review, diff, pr-review

Level 0🌱 입문자
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Codex 가 두 번째 눈

Codex 의 pipe-friendly 자연이 자연스러운 코드 리뷰어로. git diff main...HEAD | codex exec 가 PR diff 를 초 안에 리뷰. --ask-for-approval never --sandbox read-only 가 edit X 보장 — 순수 리뷰. --output-format json 과 결합해 CI 다운스트림 파싱.

알아야 할 두 리뷰 깊이: (1) diff 리뷰 — Codex 가 patch 만 봐, 빠르고 빡빡, "명백한 버그" 탐지에 좋음; (2) diff-in-context 리뷰 — Codex 가 풀 파일 + diff 읽어, 느린데 patch 만으로 안 잡히는 이슈 잡음 (e.g., patch 는 fine 인데 그 앉은 함수가 이제 redundant).

Code

Diff review in one command·bash
# Fast: review the patch alone
git diff main...HEAD | codex exec \
  --ask-for-approval never --sandbox read-only \
  "Review for bugs, security, and missing tests. Format:
   [SEVERITY] desc (file:line)" \
  --output-last-message > review.md

# In-context: full file + diff
codex exec --ask-for-approval never --sandbox read-only \
  "Read src/auth.ts in full, then review the staged changes
   in context. Flag any newly-introduced inconsistencies." \
  > review.md
GitHub Action posting reviews·yaml
name: Codex Review
on:
  pull_request: { types: [opened, synchronize] }

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - run: npm install -g @openai/codex
      - name: Run review
        env: { OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} }
        run: |
          git diff origin/main...HEAD | codex exec \
            --ask-for-approval never --sandbox read-only \
            "PR review: bugs, security, perf, style." \
            --output-last-message > review.md
      - uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = fs.readFileSync('review.md', 'utf8');
            github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body: '## Codex Review\n' + review
            });

External links

Exercise

Codex 리뷰를 실제 repo 에 wire — push 전 셸 스크립트, 또는 GitHub Action. 실제 PR 에 테스트. 리뷰 댓글 캡처.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.