[FIX] 분석 결과별 summary와 리포트 총평 생성 개선 - #198
Conversation
|
Warning Review limit reached
Next review available in: 45 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough분석 결과 요약이 점수와 세부 분석 데이터를 반영하도록 변경되었습니다. Gemini는 Changes분석 리포트 생성 흐름
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AnalysisProcessingService
participant ReportGenerationService
participant GeminiClient
participant AnalysisResultEnricher
participant GeneratedAnalysisReport
AnalysisProcessingService->>ReportGenerationService: 원본 분석 결과 전달
ReportGenerationService->>GeminiClient: summary와 report JSON 요청
GeminiClient-->>ReportGenerationService: 구조화된 Gemini 응답 반환
ReportGenerationService->>AnalysisResultEnricher: 실패 시 원본 결과 보강
AnalysisResultEnricher-->>ReportGenerationService: 규칙 기반 summary와 report 데이터 반환
ReportGenerationService-->>AnalysisProcessingService: GeneratedAnalysisReport 반환
AnalysisProcessingService->>GeneratedAnalysisReport: summary를 분석 결과에 반영
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/java/com/mr/domain/analysis/generator/AnalysisResultEnricher.java`:
- Around line 49-60: 한 문장 요약 계약을 생성과 검증에 일관되게 적용하세요. AnalysisResultEnricher.java
49-60의 fallback 요약은 강점·보완점·근거 절을 연결하되 문장 종결을 하나만 포함하도록 수정하세요.
ReportGenerationService.java 147-152에서는 여러 문장 종결을 포함한 LLM summary를 거부하고 규칙 기반
fallback으로 전환하세요. AnalysisResultEnricherTest.java 21-26에는 fallback이 한 문장인지 검증하고,
ReportGenerationServiceTest.java 64-80에는 다문장 LLM summary가 fallback으로 전환되는 테스트를
추가하세요.
In `@src/main/java/com/mr/domain/analysis/service/ReportGenerationService.java`:
- Line 32: Update the MIN_REPORT_LENGTH constant in ReportGenerationService to
700 so validation matches the SYSTEM_PROMPT contract. Add a fallback test
covering the boundary values, including reports below 700 characters and exactly
700 characters.
- Around line 114-118: Update AnalysisResultEnricher with an explicit
forced-regeneration API, then change the fallback path in
ReportGenerationService so it generates the report summary from the original
analysisResult rather than reusing an existing summary returned by enrich. Add a
fallback test covering input analysis data that already contains a non-empty
summary and verify a newly generated rule-based summary is stored.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c8723433-519d-46c5-a8ee-cde9ea53f1ac
📒 Files selected for processing (11)
src/main/java/com/mr/domain/analysis/generator/AnalysisResultEnricher.javasrc/main/java/com/mr/domain/analysis/model/GeneratedAnalysisReport.javasrc/main/java/com/mr/domain/analysis/service/AnalysisProcessingService.javasrc/main/java/com/mr/domain/analysis/service/ReportGenerationService.javasrc/main/java/com/mr/global/client/gemini/GeminiClient.javasrc/test/java/com/mr/domain/analysis/generator/AnalysisResultEnricherTest.javasrc/test/java/com/mr/domain/analysis/service/AnalysisProcessingServiceTest.javasrc/test/java/com/mr/domain/analysis/service/AnalysisStateServiceTest.javasrc/test/java/com/mr/domain/analysis/service/ReportGenerationServiceTest.javasrc/test/java/com/mr/global/client/gemini/GeminiClientTest.javasrc/test/java/com/mr/global/config/AiServerPropertiesBindingTest.java
- Gemini 구조화 응답으로 summary와 report 동시 생성 - 분석 점수 및 세부 근거를 summary와 총평에 반영 - 응답 검증 실패 시 규칙 기반 생성으로 fallback - LLM summary를 분석 결과와 함께 저장 - AI 설정 바인딩 테스트의 환경 변수 의존성 제거
dd66035 to
b7772d2
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/com/mr/domain/analysis/service/ReportGenerationServiceTest.java (1)
195-223: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win유효한 양 끝값도 테스트하세요.
현재 테스트는 699자와 1,501자만 거부하는지 검증합니다. 구현이 700자 또는 1,500자를 잘못 거부해도 이 테스트들은 통과합니다. 700자와 1,500자 보고서가
ReportGenerationType.LLM으로 생성되는 테스트를 추가하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/mr/domain/analysis/service/ReportGenerationServiceTest.java` around lines 195 - 223, 현재 경계값만 거부되는지 검증하도록 `generate_fallsBackWhenGeminiReportIs699Characters` 및 인접 테스트에 700자와 1,500자 보고서 사례를 추가하세요. 각 사례에서 `service.generate(result)`의 결과가 `ReportGenerationType.LLM`인지 확인하고, 기존 699자·1,501자 폴백 검증은 유지하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@src/test/java/com/mr/domain/analysis/service/ReportGenerationServiceTest.java`:
- Around line 195-223: 현재 경계값만 거부되는지 검증하도록
`generate_fallsBackWhenGeminiReportIs699Characters` 및 인접 테스트에 700자와 1,500자 보고서
사례를 추가하세요. 각 사례에서 `service.generate(result)`의 결과가 `ReportGenerationType.LLM`인지
확인하고, 기존 699자·1,501자 폴백 검증은 유지하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: abcbbe05-c728-454e-a5a3-9d57f9250f9b
📒 Files selected for processing (4)
src/main/java/com/mr/domain/analysis/generator/AnalysisResultEnricher.javasrc/main/java/com/mr/domain/analysis/service/ReportGenerationService.javasrc/test/java/com/mr/domain/analysis/generator/AnalysisResultEnricherTest.javasrc/test/java/com/mr/domain/analysis/service/ReportGenerationServiceTest.java
🚧 Files skipped from review as they are similar to previous changes (3)
- src/test/java/com/mr/domain/analysis/generator/AnalysisResultEnricherTest.java
- src/main/java/com/mr/domain/analysis/service/ReportGenerationService.java
- src/main/java/com/mr/domain/analysis/generator/AnalysisResultEnricher.java
📍 개요
⛓️💥 관련 이슈
🛠️ 작업 내용
🔥 리뷰 요청 사항
✅ 체크리스트
📎 참고 사항
Summary by CodeRabbit
새 기능
개선 사항