Skip to content

[improve/#66] 커밋 분석 Gemini 호출 단일화#67

Merged
wantkdd merged 3 commits into
developfrom
improve/wantkdd-commit-analysis-single-call#66
Jun 1, 2026
Merged

[improve/#66] 커밋 분석 Gemini 호출 단일화#67
wantkdd merged 3 commits into
developfrom
improve/wantkdd-commit-analysis-single-call#66

Conversation

@wantkdd
Copy link
Copy Markdown
Collaborator

@wantkdd wantkdd commented Jun 1, 2026

✨ 작업 개요

커밋 분석 시 같은 diff를 Gemini LLM에 두 번 전달하던 구조를 정리했습니다.
기존 API 응답과 Chroma 저장 형식은 유지하면서, 한 번 생성한 커밋 분석 결과를 요약 응답과 임베딩 저장 단계에서 재사용합니다.

📄 작업 내용

  • 커밋 분석 통합 결과 모델 추가
    • 사용자 표시용 summary
    • 임베딩용 변경요약, 기술키워드, 변경방향, 파일맥락
  • /api/commit/analyze에서 생성한 분석 결과를 BackgroundTasks 임베딩 저장에 전달
  • /api/commit/analyze/runs 비동기 파이프라인에서 분석 결과를 summary_readyembedding 단계가 함께 사용하도록 변경
  • 분석 결과를 전달받은 임베딩 저장은 Gemini LLM을 재호출하지 않도록 보장
  • 임베딩 저장 실패 시 run 상태가 failed로 유지되는 회귀 테스트 추가

📌 관련 이슈

🔌 API 변경사항

  • 없음
  • 기존 /api/commit/analyze 응답 필드 유지
  • 기존 /api/commit/analyze/runs 상태/결과 응답 필드 유지

💬 기타 사항

  • Gemini Embedding API 호출은 기존처럼 유지됩니다.
  • 줄어드는 대상은 커밋 diff를 입력으로 받는 Gemini LLM 분석 호출입니다.
  • 분석 결과 재사용은 별도 DB 저장이 아니라 요청 처리 중 메모리 객체 전달 방식입니다.

✅ 테스트

  • uv run pytest → 115 passed
  • uv run ruff check → All checks passed!

wantkdd added 3 commits June 1, 2026 20:01
커밋 diff를 한 번 분석해 사용자 요약과 임베딩 재료를 함께 만들도록 내부 분석 결과를 통합합니다.

Constraint: 기존 summary 응답과 Chroma 임베딩 문서 구성은 유지해야 함

Rejected: 요약용 Gemini 호출과 임베딩용 Gemini 호출 분리 유지 | 큰 diff 입력 토큰이 중복 발생함

Confidence: high

Scope-risk: moderate

Directive: 외부 응답 스키마를 바꾸지 말고 내부 분석 결과 재사용만 확장할 것

Tested: uv run pytest; uv run ruff check

Not-tested: 실제 Gemini 운영 응답 A/B 비교
동기 분석과 비동기 run에서 한 번 만든 커밋 분석 결과를 임베딩 저장 단계에 그대로 전달합니다.

Constraint: /api/commit/analyze와 /api/commit/analyze/runs 응답 필드는 그대로 유지해야 함

Rejected: 백그라운드 임베딩 단계에서 diff를 다시 Gemini에 전달 | 동일 입력을 중복 과금함

Confidence: high

Scope-risk: narrow

Directive: 분석 결과는 요청 처리 중 메모리 객체로만 전달하고 별도 저장소 계약을 만들지 말 것

Tested: uv run pytest; uv run ruff check

Not-tested: 운영 BackgroundTasks 실패 로그 확인
커밋 분석 결과가 임베딩 저장 단계로 전달되고 실패 시 run 상태가 실패로 유지되는지 검증합니다.

Constraint: 내부 호출 수를 줄이더라도 동기/비동기 API 결과 계약은 유지해야 함

Rejected: 호출 수 감소를 수동 확인에만 의존 | 비용 회귀를 테스트로 잡기 어려움

Confidence: high

Scope-risk: narrow

Directive: 커밋 분석 비용 최적화 변경 시 LLM 재호출 방지 테스트를 유지할 것

Tested: uv run pytest; uv run ruff check

Not-tested: 실제 Gemini 과금량 대시보드 비교
@wantkdd wantkdd added the 🚀 Feat 기능 구현 및 수정 label Jun 1, 2026
@wantkdd wantkdd self-assigned this Jun 1, 2026
@wantkdd wantkdd requested a review from Yujin1219 June 1, 2026 11:02
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Warning

Review limit reached

@wantkdd, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 minutes and 26 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: af4aad49-6d59-47f7-acb8-d019716612a8

📥 Commits

Reviewing files that changed from the base of the PR and between bf510d2 and ef28169.

📒 Files selected for processing (5)
  • app/domains/commit/router.py
  • app/domains/commit/services/analyze_runs.py
  • app/domains/commit/services/summarize.py
  • tests/test_application_commit_matching.py
  • tests/test_commit_analyze_runs.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve/wantkdd-commit-analysis-single-call#66

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wantkdd wantkdd merged commit 785e1b2 into develop Jun 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 Feat 기능 구현 및 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[improve] 커밋 분석 Gemini 호출 단일화

1 participant