Skip to content

feat: AI 분석 결과 기반 캘린더 미리보기 자동 생성#67

Merged
deli-minju merged 2 commits into
developfrom
feat/#65-calendar-preview-from-ai
May 25, 2026
Merged

feat: AI 분석 결과 기반 캘린더 미리보기 자동 생성#67
deli-minju merged 2 commits into
developfrom
feat/#65-calendar-preview-from-ai

Conversation

@deli-minju
Copy link
Copy Markdown
Contributor

@deli-minju deli-minju commented May 25, 2026

📌 작업 요약

  • 요약:
    • AI 분석 결과에서 dateStatus=confirmed이고 datetime이 파싱 가능한 항목을 캘린더 미리보기 Redis 데이터로 자동 생성
    • AI 분석으로 저장된 checklist/TODO ID를 calendar preview의 checklistIds에 연결
    • 확정 날짜가 없는 분석 결과는 기존 calendar preview를 삭제해 오래된 일정 후보가 남지 않도록 처리
    • AI 분석 응답 저장 정책 문서에 calendar preview 생성 기준 반영
    • AI 컨테이너 OpenAI 기본 모델 설정을 gpt-4.1-mini로 변경
  • 관련 이슈: closes [FEAT] AI 분석 결과 기반 캘린더 미리보기 자동 생성 #65

🌿 브랜치 정보

  • Source: feat/#65-calendar-preview-from-ai
  • Target: develop (기본)

✅ 체크리스트

  • 브랜치 컨벤션 준수 (feat/refac/hotfix/chore/design/bugfix)
  • 커밋 컨벤션 준수 (feat/fix/refactor/docs/style/chore)
  • self-review 완료
  • 테스트 및 로컬 실행 확인 완료

🧪 테스트 결과

PS C:\Users\mjmdm\IdeaProjects\GACHI-BE> .\gradlew.bat --no-daemon test --tests com.gachi.be.domain.newsletter.pipeline.NewsletterAiAnalyzerTest

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 뉴스레터 항목 추출 시 캘린더 미리보기가 자동으로 생성되도록 개선
  • 개선 사항

    • AI 모델 기본 설정 업데이트
    • 날짜 상태 처리 정책 명확화 및 캘린더 이벤트 검증 기준 강화
  • 문서

    • 뉴스레터 AI 분석 통합 정책 문서 업데이트

Review Change Stack

@deli-minju deli-minju self-assigned this May 25, 2026
@deli-minju deli-minju added the feat 새로운 기능 추가 작업 label May 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@deli-minju, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 39 minutes and 27 seconds.

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

⌛ How to resolve this issue?

After more review capacity refills, 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 have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3326476f-e35e-4c9d-a16a-c2f28dfd6324

📥 Commits

Reviewing files that changed from the base of the PR and between 5316f98 and 812a4ba.

📒 Files selected for processing (2)
  • src/main/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzer.java
  • src/test/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzerTest.java
📝 Walkthrough

워크스루

NewsletterAiAnalyzer의 분석 결과 저장 흐름이 확장되어, 추출된 항목을 Checklist로 저장한 후 확정 날짜를 가진 항목들을 캘린더 미리보기 Redis에 자동으로 저장함. 환경 변수 및 정책 문서 업데이트와 함께 관련 테스트 케이스가 추가됨.

변경 사항

AI 분석 결과 기반 캘린더 미리보기 자동 생성

Layer / File(s) Summary
구성 및 정책 문서화
deploy/.env.example, deploy/docker-compose.yml, docs/newsletter-ai-analyze-integration.md, src/main/java/com/gachi/be/domain/calendar/service/CalendarPreviewRedisService.java
OpenAI 모델을 gpt-4o-mini에서 gpt-4.1-mini로 변경하고, calendar preview 생성 정책(확정 날짜 필터링, 미표기 항목 제외)과 호환성 규칙(빈 items 배열 허용, preview 삭제 시점)을 문서화함
캘린더 Preview 서비스 통합
src/main/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzer.java
CalendarPreviewRedisService 의존성 주입, saveExtractedItems(...) 반환값을 List<SavedExtractedItem>으로 변경하여 저장된 항목 정보 전달, saveCalendarPreview(...) 메서드 추가로 확정 날짜 필터링 후 preview event 생성 및 저장, 대상 없을 시 기존 preview 삭제
테스트 검증
src/test/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzerTest.java
CalendarPreviewRedisService mock 및 ArgumentCaptor로 preview 저장 호출 검증, checklistRepository.saveAll 스텁을 thenAnswer로 변경하여 생성된 Checklist id 고정 및 preview event 내 checklistIds 매칭 확인, 확정 날짜 부재 시 preview 삭제 호출 검증 테스트 추가

시퀀스 다이어그램

sequenceDiagram
  participant NewsletterAiAnalyzer
  participant ChecklistRepository
  participant CalendarPreviewRedisService
  
  NewsletterAiAnalyzer->>ChecklistRepository: saveAll(filteredItems)
  ChecklistRepository-->>NewsletterAiAnalyzer: savedChecklists
  NewsletterAiAnalyzer->>NewsletterAiAnalyzer: 저장된 항목과 원본 item 매핑<br/> SavedExtractedItem 리스트 생성
  NewsletterAiAnalyzer->>NewsletterAiAnalyzer: dateStatus=confirmed 필터링<br/> 정규화된 datetime 존재 확인
  alt 확정 날짜 항목 있음
    NewsletterAiAnalyzer->>NewsletterAiAnalyzer: CalendarPreviewEvent 리스트 구성
    NewsletterAiAnalyzer->>CalendarPreviewRedisService: savePreview(newsletterId, events)
  else 확정 날짜 항목 없음
    NewsletterAiAnalyzer->>CalendarPreviewRedisService: deletePreview(newsletterId)
  end
Loading

예상 코드 리뷰 노력

🎯 3 (Moderate) | ⏱️ ~25 분

연관 이슈

  • #65: AI 분석 결과 중 확정 날짜 항목을 캘린더 미리보기로 자동 생성하는 요구사항을 구현함. dateStatus 정책, preview 대상 필터링, checklist id 연결, preview 삭제 시점이 모두 반영됨.

연관 PR

  • GACHI-Project/GACHI-BE#64: NewsletterAiAnalyzer의 analyze(...) 메서드 리팩토링이 겹치는 부분으로, 해당 PR에서 AI 서버 응답 처리를 변경한 후 본 PR에서 calendar preview 저장 흐름을 추가하는 순차적 관계.
  • GACHI-Project/GACHI-BE#59: NewsletterAiAnalyzer의 추출 항목 저장 흐름을 다루는 이전 PR로, 본 PR의 saveExtractedItems(...) 리팩토링과 코드 레벨 연관성 있음.

제안 리뷰어

  • Hminkyung
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항인 AI 분석 결과 기반 캘린더 미리보기 자동 생성을 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 작업 요약, 브랜치 정보, 체크리스트, 테스트 결과를 포함하며 템플릿 구조를 따르고 있습니다.
Linked Issues check ✅ Passed 변경 사항이 이슈 #65의 모든 주요 요구사항(confirmed dateStatus 필터링, preview 자동 생성, checklist ID 연결, 오래된 preview 삭제 정책)을 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 캘린더 미리보기 자동 생성과 관련된 기능 구현, 문서화, 테스트에 집중되어 있으며 범위 내입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#65-calendar-preview-from-ai

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/main/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzer.java`:
- Around line 54-55: saveCalendarPreview 호출에서 발생하는 Redis 저장/삭제 예외가 analyze(...)
밖으로 전파되어 전체 파이프라인을 실패시키므로 saveCalendarPreview(...) 호출을 호출부(예: analyze 메서드 내)에서
try-catch로 감싸고 예외를 로깅한 뒤 무시하도록 변경하세요; 즉 analyze(...) 흐름 중 checklist 저장이 성공한 후의
preview 저장 실패는 예외를 전파하지 않고 로그 처리만 하여 분석 본 흐름이 계속되게 하며 동일한 패턴을 파일 내 다른
saveCalendarPreview 호출 지점(또는 126-155 범위의 유사 코드)에도 적용하세요.
🪄 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.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0d1c412a-60d1-466f-9e6d-11c3e1a8c90f

📥 Commits

Reviewing files that changed from the base of the PR and between 79d16a0 and 5316f98.

📒 Files selected for processing (6)
  • deploy/.env.example
  • deploy/docker-compose.yml
  • docs/newsletter-ai-analyze-integration.md
  • src/main/java/com/gachi/be/domain/calendar/service/CalendarPreviewRedisService.java
  • src/main/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzer.java
  • src/test/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzerTest.java

Comment thread src/main/java/com/gachi/be/domain/newsletter/pipeline/NewsletterAiAnalyzer.java Outdated
@deli-minju deli-minju requested a review from Hminkyung May 25, 2026 07:14
Copy link
Copy Markdown
Collaborator

@Hminkyung Hminkyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인 완료했습니다!! 고생하셨습니다~

@deli-minju deli-minju merged commit b193aba into develop May 25, 2026
3 checks passed
@deli-minju deli-minju deleted the feat/#65-calendar-preview-from-ai branch May 25, 2026 08:48
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.

[FEAT] AI 분석 결과 기반 캘린더 미리보기 자동 생성

2 participants