Skip to content

Codex automated review pipeline#5

Open
za0012 wants to merge 3 commits into
Nextsfrom
codex-automated-review-pipeline
Open

Codex automated review pipeline#5
za0012 wants to merge 3 commits into
Nextsfrom
codex-automated-review-pipeline

Conversation

@za0012

@za0012 za0012 commented Jul 2, 2026

Copy link
Copy Markdown
Owner

개요

LLM 연동을 지원하는 PR 기반 자동 코드 리뷰 파이프라인을 구축했습니다.

개인 프로젝트에서 코드 품질, 구조 개선점, 테스트 누락 여부를 수동으로 점검하기 어려운 문제를 해결하기 위해 AGENTS.mdreview-agents 프롬프트를 기반으로 변경 diff를 자동 분석하는 리뷰 하네스를 추가했습니다.

주요 변경 사항

  • GitHub Actions 기반 PR 자동 리뷰 workflow 추가
  • bun run review 명령으로 실행 가능한 리뷰 하네스 추가
  • PR diff, 변경 파일, lint/typecheck/test/build 결과 수집
  • 리뷰 결과를 Markdown/JSON 리포트로 생성
  • GitHub PR 댓글 자동 생성 및 기존 댓글 업데이트 처리
  • Notion 자동 퍼블리싱을 위한 scheduled workflow 추가
  • AGENTS.md에 주요 리뷰 기준 명시
    • 의미 있는 변수/함수 네이밍
    • Early Return 기반 가독성 개선
    • 런타임 성능 및 복잡도 점검

현재 동작 방식

현재는 과금 방지를 위해 OPENAI_API_KEY를 설정하지 않은 상태에서도 파이프라인이 동작하도록 구성했습니다.

  • OpenAI API 키가 없으면 LLM 리뷰 단계는 스킵됩니다.
  • 대신 lint/typecheck/test/build 결과를 수집해 PR 댓글로 자동 게시합니다.
  • 추후 OPENAI_API_KEY를 GitHub Secrets에 등록하면 LLM 기반 리뷰까지 활성화할 수 있습니다.

검증 결과

GitHub Actions에서 자동 리뷰 workflow가 실행되었고, PR 댓글이 정상적으로 생성되었습니다.

현재 댓글에 표시된 실패 항목은 파이프라인 자체 오류라기보다 기존 코드의 lint/typecheck/test/build 실패를 하네스가 감지한 결과입니다.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

자동 PR 코드 리뷰

  • 실행 유형: PR 리뷰
  • 생성 시각: 2026-07-06T08:44:02.891Z
  • 기준 커밋: ad3850bc15072aff59e14bebd784c832817e1c09
  • 대상 커밋: 0e324a626c088fca239006fc1f611f6b5019cb95
  • 변경 파일 수: 20
  • 발견 항목 수: 4
  • 이번 PR 영향 가능 항목: 0
  • 기존 실패 추정 항목: 4

검증 결과

  • Lint: 실패 (1) - bun biome check .
  • TypeScript 타입 검사: 실패 (2) - "/home/runner/.bun/bin/bun" "/home/runner/work/codeTest/codeTest/node_modules/typescript/bin/tsc" --noEmit --pretty false
  • 테스트: 실패 (1) - bun run test
  • 빌드: 실패 (1) - bun run build

이번 PR 영향 가능 항목

이번 PR 변경 파일에서 직접 발생한 것으로 보이는 항목은 없습니다.

기존 실패로 추정되는 항목

P1 빌드 실패

  • 위치: package.json
  • 출처: harness
  • 분류: 기존 실패 추정
  • 영향: 빌드 검증이 실패했지만, 출력에 나타난 파일이 이번 PR 변경 파일 밖에 있어 기존 실패일 가능성이 큽니다.
  • 제안 수정: 로컬에서 bun run build를 실행한 뒤 아래 첫 출력부터 수정하세요.
    $ bun next build
    Failed to type check.

./src/app/(with-sidebar)/problems/components/problem-add/TagSection.tsx:83:31
Type error: Parameter 'tag' implicitly has an 'any' type.

81 |


82 | {selectedTags.length > 0 ? (

83 | selectedTags.map((tag) => (
| ^
84 | <span
85 | key={tag}
86 | className="text-[12px] text-[#8b95a1] font-medium"
Next.js build worker exited with code: 1 and signal: null
error: "next" exited with code 1
error: script "build" exited with code 1
⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
▲ Next.js 16.2.4 (Turbopack)

Creating an optimized production build ...
✓ Compiled successfully in 11.3s
Running TypeScript ...

  • 확인 방법: bun run build가 exit code 0으로 종료되면 해결된 것입니다.

P1 테스트 실패

  • 위치: src/**/*.test.ts
  • 출처: harness
  • 분류: 기존 실패 추정
  • 영향: 테스트 검증이 실패했지만, 출력에 나타난 파일이 이번 PR 변경 파일 밖에 있어 기존 실패일 가능성이 큽니다.
  • 제안 수정: 로컬에서 bun run test를 실행한 뒤 아래 첫 출력부터 수정하세요.
    $ bun test ./src//*.test.ts
    Test filter "./src/
    /*.test.ts" had no matches
    error: script "test" exited with code 1
    bun test v1.3.14 (0d9b296a)
  • 확인 방법: bun run test가 exit code 0으로 종료되면 해결된 것입니다.

P1 TypeScript 타입 검사 실패

  • 위치: src/components/Sidebar.tsx
  • 출처: harness
  • 분류: 기존 실패 추정
  • 영향: TypeScript 타입 검사 검증이 실패했지만, 출력에 나타난 파일이 이번 PR 변경 파일 밖에 있어 기존 실패일 가능성이 큽니다.
  • 제안 수정: 로컬에서 "/home/runner/.bun/bin/bun" "/home/runner/work/codeTest/codeTest/node_modules/typescript/bin/tsc" --noEmit --pretty false를 실행한 뒤 아래 첫 출력부터 수정하세요.
    src/app/(with-sidebar)/problems/components/problem-add/TagSection.tsx(83,31): error TS7006: Parameter 'tag' implicitly has an 'any' type.
    src/app/(with-sidebar)/problems/page.tsx(135,15): error TS2322: Type 'any[] | undefined' is not assignable to type 'string[]'.
    Type 'undefined' is not assignable to type 'string[]'.
    src/app/(without-sidebar)/find/page.tsx(7,23): error TS2306: File '/home/runner/work/codeTest/codeTest/src/app/(without-sidebar)/find/component/MakeStudy.tsx' is not a module.
    src/components/Sidebar.tsx(49,36): error TS18048: 'study' is possibly 'undefined'.
    src/components/ui/Logo.tsx(2,21): error TS2307: Cannot find module '../../../public/Logo.png' or its corresponding type declarations.
    src/components/ui/calendar.tsx(94,9): error TS2353: Object literal may only specify known properties, and 'table' does not exist in type 'Partial'.
    src/lib/store/studyStore.ts(6,3): error TS2322: Type 'null' is not assignable to type 'string'.
    src/lib/store/studyStore.ts(7
    [output truncated]
  • 확인 방법: "/home/runner/.bun/bin/bun" "/home/runner/work/codeTest/codeTest/node_modules/typescript/bin/tsc" --noEmit --pretty false가 exit code 0으로 종료되면 해결된 것입니다.

P2 Lint 실패

  • 위치: package.json

  • 출처: harness

  • 분류: 기존 실패 추정

  • 영향: Lint 검증이 실패했지만, 출력에 나타난 파일이 이번 PR 변경 파일 밖에 있어 기존 실패일 가능성이 큽니다.

  • 제안 수정: 로컬에서 bun biome check .를 실행한 뒤 아래 첫 출력부터 수정하세요.
    src/app/(with-sidebar)/mypage/components/BarChart/view.tsx:8:3 lint/correctness/noUnusedImports FIXABLE ━━━━━━━━━━

    ! Several of these imports are unused.

    6 │ CartesianGrid,
    7 │ Label,

    8 │ LabelList,
    │ ^^^^^^^^^
    9 │ type LabelProps,
    10 │ ResponsiveContainer,

    i Unused imports might be the result of an incomplete refactoring.

    i Unsafe fix: Remove the unused imports.

    6   6 │     CartesianGrid,
    7   7 │     Label,
    8     │ -   LabelList,
    9   8 │     type LabelProps,
    

    10 9 │ ResponsiveContainer,

src/app/(with-sidebar)/mypage/components/BarChart/view.tsx:34:7 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━

! This variable CustomColorLabel is unused.

32 │ };
33 │ 

34 │ const CustomColorLabel = (props: LabelProps) => {
│ ^^^^^^^^^^^^^^^^
35 │ const fill = COLORS[(props.index ?? 0) % COLORS.length];
36 │ return <Label {...props} fill={fill} />;

[output truncated]

  • 확인 방법: bun biome check .가 exit code 0으로 종료되면 해결된 것입니다.

경고

  • Lint 실패: exit code 1.
  • TypeScript 타입 검사 실패: exit code 2.
  • 테스트 실패: exit code 1.
  • 빌드 실패: exit code 1.
  • OpenAI review skipped because OPENAI_API_KEY is missing.

- Updated GitHub Actions workflows to change artifact paths from `review-output/` to `tools/code-review/output/`.
- Added `.gitignore` entry for the new output directory.
- Modified `package.json` to point the review script to the new location of `review-harness.ts`.
- Introduced a new `README.md` for the code review harness detailing its flow, review criteria, required secrets, and workflows.
- Created various agent files for specific review types: architecture, bug, performance, report quality, security, and test reviewers.
- Implemented the main review harness in `review-harness.ts` to handle the review process, including running checks and interacting with OpenAI's API.
- Added integration files for GitHub comments and Notion export.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant