Repository navigation
fix: improve 답변 Null로 반환하는 이슈 해결 - #21
Conversation
|
Need an answer fast? Review this PR in Change Stack to ask focused questions about the PR or a changed range. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough이 PR은 AI 피드백의 improvement가 null/공백일 때 기본 메시지로 치환하는 로직을 도입하고, InterviewSubmissionService에서 개인정보 검출을 제거하며 ProjectSessionService에 코드 콘텐츠 개인정보 검증을 추가하고 관련 DTO/OpenAPI/예외 처리와 테스트를 갱신합니다. Changes개선문구 정규화 및 개인정보 검출 흐름 변경
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/test/java/com/example/trouble_log/domain/interview/service/InterviewServiceTest.java`:
- Around line 89-108: Add a sibling test to cover the blank-string case: in
InterviewServiceTest create an AnswerFeedbackResult whose improvement is a
whitespace string (e.g., " "), stub promptService.evaluateAnswer(...) to
return it, prepare the same existingAnswer and AnswerRequest, call
interviewService.saveAnswer(1L, 1L, request) and assert that
response.getImprovement() equals the same default improvement string used in
saveAnswerReturnsDefaultImprovementWhenAiImprovementIsNull; this ensures the
service logic that checks isBlank() (via promptService.evaluateAnswer,
AnswerFeedbackResult, and interviewService.saveAnswer) is exercised for blank
input as well.
🪄 Autofix (Beta)
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.yml
Review profile: CHILL
Plan: Pro
Run ID: 21e5b15a-6eaf-42da-aa73-367735e3900e
📒 Files selected for processing (2)
src/main/java/com/example/trouble_log/domain/interview/service/InterviewService.javasrc/test/java/com/example/trouble_log/domain/interview/service/InterviewServiceTest.java
개인정보 처리 플로우 수정
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/test/java/com/example/trouble_log/domain/interview/service/InterviewSubmissionServiceTest.java (1)
49-71: 💤 Low value테스트 완성도를 위해 추가 assertion 고려
다른 테스트(
submitReturnsReadyWhenAllAnswersDoNotContainPersonalInfo, lines 93-96)에서는blockedReason과warnings도 함께 검증하고 있습니다. 일관성을 위해 이 테스트에도 동일한 assertion을 추가하면 응답 객체 전체가 예상대로 반환되는지 명확히 확인할 수 있습니다.♻️ 제안하는 수정
InterviewSubmitResponse response = interviewSubmissionService.submit(1L, request); assertThat(response.getSubmitted()).isTrue(); assertThat(response.getReportGenerationReady()).isTrue(); + assertThat(response.getBlockedReason()).isNull(); + assertThat(response.getWarnings()).isEmpty(); }🤖 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/example/trouble_log/domain/interview/service/InterviewSubmissionServiceTest.java` around lines 49 - 71, Add assertions to verify the response's blockedReason and warnings for completeness: after calling interviewSubmissionService.submit(...) assert that response.getBlockedReason() is null (no blocking reason) and that response.getWarnings() contains at least one warning about personal info (e.g., isNotEmpty()/contains relevant message). This change should be added inside submitDoesNotBlockWhenAnswerContainsPersonalInfo() alongside the existing checks of getSubmitted() and getReportGenerationReady().
🤖 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/test/java/com/example/trouble_log/domain/projectSession/service/ProjectSessionServiceTest.java`:
- Around line 41-53: Add a positive success test to ProjectSessionServiceTest
that verifies create(request) succeeds when code content contains no personal
info: mock a Member (mockMember) and stub memberRepository.findById(1L) to
return it, mock a ProjectSession (mockSession) and stub
projectSessionRepository.save(...) to return mockSession, call
projectSessionService.create(...) with a clean ProjectSessionRequest (e.g.,
greeting code), assert the returned ProjectSessionResponse.getSessionId() equals
mockSession.getId(), and verify projectSessionRepository.save(...) was invoked;
use the same symbols shown (projectSessionService.create, memberRepository,
projectSessionRepository, ProjectSessionRequest, ProjectSessionResponse) and
avoid triggering PersonalInfoDetectedException.
---
Nitpick comments:
In
`@src/test/java/com/example/trouble_log/domain/interview/service/InterviewSubmissionServiceTest.java`:
- Around line 49-71: Add assertions to verify the response's blockedReason and
warnings for completeness: after calling interviewSubmissionService.submit(...)
assert that response.getBlockedReason() is null (no blocking reason) and that
response.getWarnings() contains at least one warning about personal info (e.g.,
isNotEmpty()/contains relevant message). This change should be added inside
submitDoesNotBlockWhenAnswerContainsPersonalInfo() alongside the existing checks
of getSubmitted() and getReportGenerationReady().
🪄 Autofix (Beta)
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.yml
Review profile: CHILL
Plan: Pro
Run ID: 27463613-aa35-4c09-951c-6e141569d5c3
📒 Files selected for processing (9)
src/main/java/com/example/trouble_log/domain/interview/controller/InterviewSubmissionController.javasrc/main/java/com/example/trouble_log/domain/interview/dto/PersonalInfoDetectionResponse.javasrc/main/java/com/example/trouble_log/domain/interview/service/InterviewSubmissionService.javasrc/main/java/com/example/trouble_log/domain/projectSession/controller/ProjectSessionController.javasrc/main/java/com/example/trouble_log/domain/projectSession/service/ProjectSessionService.javasrc/main/java/com/example/trouble_log/global/exception/GlobalExceptionHandler.javasrc/test/java/com/example/trouble_log/domain/interview/service/InterviewServiceTest.javasrc/test/java/com/example/trouble_log/domain/interview/service/InterviewSubmissionServiceTest.javasrc/test/java/com/example/trouble_log/domain/projectSession/service/ProjectSessionServiceTest.java
✅ Files skipped from review due to trivial changes (2)
- src/main/java/com/example/trouble_log/domain/interview/controller/InterviewSubmissionController.java
- src/main/java/com/example/trouble_log/domain/projectSession/controller/ProjectSessionController.java
🚧 Files skipped from review as they are similar to previous changes (1)
- src/test/java/com/example/trouble_log/domain/interview/service/InterviewServiceTest.java
개인정보 없는 케이스 사례 추가
✨ 관련된 이슈
🙌 작업 내용
📸 스크린샷 (선택)
🤔 리뷰 요구사항(선택)
Summary by CodeRabbit
개선사항
새 기능
행동 변경
테스트
문서