Skip to content

[chore] prod 배포 v1.0.7 - #206

Merged
theminjunchoi merged 1 commit into
prodfrom
dev
Aug 23, 2026
Merged

[chore] prod 배포 v1.0.7#206
theminjunchoi merged 1 commit into
prodfrom
dev

Conversation

@theminjunchoi

@theminjunchoi theminjunchoi commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

📌 개요

dev 에 쌓인 1건을 prod 로 올린다. 마이그레이션·API 변경 없다.

PR 내용
#205 메시지 하나만 보낸 대화방은 배치로 인한 카드가 영영 생기지 않는다

새벽 배치가 summary 가 없다는 이유로 카드 생성을 포기하던 것을 고친다. 요약은 프론트가 두 번째 메시지부터 실어 보내는 값이라 한 줄만 쓰고 나간 방에는 없다. 이제 그런 방은 유저가 보낸 메시지 원문으로 카드를 만든다.

실제로 8/22 05:00 배치 로그에 남아 있던 상황이다 - 대상=7, 생성=1, 탈퇴 회원=3, 요약 없음=3. 04:30 리마인더는 받았는데 05:00 카드는 못 받은 사용자가 여기서 나왔다.

⚠️ 이번 배포로 바뀌는 것

1. 다음 배치에서 8명에게 푸시가 나간다

SKIPPED 로 굳어 있던 방이 다시 대상이 된다(finishedStatuses 에서 제거). 배포 직전 prod 기준으로 복구 대상은 이렇다.

select count(*) rooms, count(distinct c.member_id) members
from conversations c join members m on m.id = c.member_id
where c.card_generation_status = 'SKIPPED' and c.status <> 'DELETED' and m.status = 'ACTIVE';
-- rooms=11, members=8  (전부 8/22 KST 생성)

마이그레이션 없이 다음 실행(8/24 05:00)에서 카드를 받고 DONE 으로 옮겨간다. 알림은 회원당 1회로 묶여 있어 11번이 아니라 8번 나간다.

카드 날짜는 8/22 다. 카드는 conversationCreatedAt 기준이라 캘린더에서 그날 칸에 꽂힌다. 반면 푸시 문구는 오늘의 감정 카드가 도착했어요 라, 알림을 받고 앱을 열면 오늘 칸에는 그 카드가 없다. 이번 한 번의 소급 처리에서만 생기는 어긋남이라 이 배포를 막을 이유는 아니지만, 문의가 올 수 있어 적어 둔다.

SKIPPED 13건 중 나머지 2건은 탈퇴 회원 방이라 WITHDRAWN_MEMBER 로 빠진다 - 탈퇴한 사람의 대화로는 아무것도 새로 만들지 않는다.

2. 대화방 요약(conversations.summary)은 오염되지 않는다

폴백으로 만든 값은 LLM 입력으로만 쓰고 대화방에 남기지 않는다. 그 자리는 다른 채팅방 댓글의 '과거 맥락' 으로 읽히는데 풀이 최근 5개뿐이라, 압축 안 된 원문이 들어가면 정보량 많은 요약을 밀어낸다.

3. 지표에서 NO_SUMMARY 가 사라진다

AutoCardOutcome.NO_SUMMARY 를 제거했다. Grafana 는 sum by (outcome) 이라 패널은 그대로 뜨고, 그 계열만 더 이상 증가하지 않는다. 알림 규칙은 이 지표를 쓰지 않는다(확인함).

CardGenerationStatus.SKIPPED 상수는 남겨 뒀다 - prod 에 그 값으로 저장된 행이 13건 있어 먼저 지우면 @Enumerated(STRING) 매핑이 깨진다. 잔여 행이 DONE 으로 옮겨간 뒤 별도 PR 로 제거한다.

🌐 API · DB 영향

  • API 변경 없음. 공개 카드 생성 API 의 summary 는 그대로 필수다(@NotBlank) - nullable 로 연 것은 서버 내부 경로뿐이다
  • 마이그레이션 없음
  • 새 시크릿 없음
  • 하위 호환 - API·데이터 모두 호환

✅ 배포 후 확인

앱 기동만 바로 확인하고, 나머지는 8/24 05:00 배치 이후에 본다.

curl -s -o /dev/null -w '%{http_code}\n' -X POST https://api.gamss.kr/api/auth/login \
  -H 'Content-Type: application/json' -d '{}'      # 400

배치 로그(8/24 새벽) - 요약 없음 이 사라지고 그만큼 생성 으로 옮겨가야 한다.

04:30  미종료 대화방 리마인더 완료: ...
05:00  자동 카드 생성 배치 완료: 대상=..., 생성=..., 탈퇴 회원=..., 실패=0
05:00  카드 생성 알림: 대상=8명 안팎, 성공=..., 실패=...

DB - 활성 회원의 SKIPPED 잔여가 0이 되어야 한다.

select card_generation_status, count(*) from conversations
where status <> 'DELETED' group by card_generation_status;

앱에서 - 8/22 칸에 카드가 새로 꽂혔는지, 그 카드가 대화 내용과 맞는 한 줄인지.

↩️ 되돌리기

앱 이미지만 이전 태그로 되돌리면 된다. DB 는 건드리지 않았다. 다만 되돌리면 그 사이 배치가 SKIPPED 를 다시 쓰기 시작한다.

📱 앱팀에 알릴 것

  • 8/24 새벽에 8명이 푸시를 받고, 그 카드는 8/22 날짜로 꽂힌다. 알림 문구는 "오늘의 감정 카드" 라 어긋나 보일 수 있다
  • 앞으로는 메시지를 한 줄만 쓰고 나가도 카드가 나온다. "요약을 보내지 않으면 카드가 안 생긴다"는 기존 전제가 없어졌다

Summary by CodeRabbit

  • 새로운 기능

    • 대화 요약이 없어도 사용자 메시지를 기반으로 자동 카드를 생성합니다.
    • 카드 생성과 감정 분류에 최근 메시지를 일관되게 활용하며, 입력 길이를 자동으로 조정합니다.
  • 개선 사항

    • 요약이 없는 대화도 자동 생성 대상에 포함됩니다.
    • 생성 실패 및 처리 완료 상태가 더욱 정확하게 반영됩니다.
    • 요약 없이 생성된 카드에서는 대화 요약을 저장하지 않습니다.

* fix: 요약 없는 대화방의 자동 카드 생성 폴백 추가

* docs: 자동 카드 배치 결과 패널 설명 정리
@github-actions

Copy link
Copy Markdown

Test Results

809 tests  +14   809 ✅ +14   2m 52s ⏱️ +5s
107 suites + 1     0 💤 ± 0 
107 files   + 1     0 ❌ ± 0 

Results for commit 5ffc1cd. ± Comparison against base commit 96b9ebe.

@github-actions

Copy link
Copy Markdown

Test Coverage

Overall Project 82.19% 🍏
Files changed 100% 🍏

File Coverage
CardPersistenceService.kt 100% 🍏
AutoCardOutcome.kt 100% 🍏
CardMessageWindow.kt 100% 🍏
CardGenerationStatus.kt 100% 🍏
PromptProvider.kt 99.4% 🍏
CardService.kt 98.25% 🍏
DailyAutoCardScheduler.kt 95.39% 🍏
Conversation.kt 92.59% 🍏
ConversationRepository.kt 61.71% 🍏

@theminjunchoi
theminjunchoi merged commit 482a4e7 into prod Aug 23, 2026
12 of 13 checks passed
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a52a06c6-545c-47ae-8a13-a12b00907a0b

📥 Commits

Reviewing files that changed from the base of the PR and between 96b9ebe and 5ffc1cd.

📒 Files selected for processing (16)
  • deploy/monitor/grafana/dashboards/llm-domain.json
  • src/main/kotlin/com/nexters/gamss/card/service/AutoCardOutcome.kt
  • src/main/kotlin/com/nexters/gamss/card/service/CardPersistenceService.kt
  • src/main/kotlin/com/nexters/gamss/card/service/CardService.kt
  • src/main/kotlin/com/nexters/gamss/card/service/DailyAutoCardScheduler.kt
  • src/main/kotlin/com/nexters/gamss/conversation/domain/CardGenerationStatus.kt
  • src/main/kotlin/com/nexters/gamss/conversation/domain/Conversation.kt
  • src/main/kotlin/com/nexters/gamss/conversation/repository/ConversationRepository.kt
  • src/main/kotlin/com/nexters/gamss/llm/prompt/CardMessageWindow.kt
  • src/main/kotlin/com/nexters/gamss/llm/prompt/PromptProvider.kt
  • src/test/kotlin/com/nexters/gamss/card/service/CardPersistenceServiceTest.kt
  • src/test/kotlin/com/nexters/gamss/card/service/CardServiceTest.kt
  • src/test/kotlin/com/nexters/gamss/card/service/DailyAutoCardSchedulerTest.kt
  • src/test/kotlin/com/nexters/gamss/conversation/repository/ConversationRepositoryAutoCardTargetTest.kt
  • src/test/kotlin/com/nexters/gamss/llm/prompt/CardMessageWindowTest.kt
  • src/test/kotlin/com/nexters/gamss/llm/prompt/PromptProviderTest.kt

Walkthrough

요약이 없는 대화방도 최근 사용자 메시지를 사용해 자동 카드를 생성합니다. 메시지 입력 구간을 중앙화하고 LLM 입력을 4000자로 제한합니다. 폴백 요약은 카드 생성에만 사용하고 대화방에는 저장하지 않습니다. SKIPPED 대화방은 다음 배치 대상에 포함됩니다.

Changes

자동 카드 생성 폴백

Layer / File(s) Summary
메시지 윈도우와 LLM 입력 처리
src/main/kotlin/com/nexters/gamss/llm/prompt/*, src/test/kotlin/com/nexters/gamss/llm/prompt/*
CardMessageWindow가 최근 사용자 메시지를 정규화하고 최대 4000자까지 선택합니다. 감정 분류와 카드 생성은 같은 메시지 구간을 사용합니다.
요약 폴백과 카드 저장
src/main/kotlin/com/nexters/gamss/card/service/*, src/test/kotlin/com/nexters/gamss/card/service/*
nullable 또는 공백 요약은 사용자 메시지로 대체합니다. 폴백 값은 대화방에 저장하지 않습니다. 메시지가 없으면 FAILEDCARD_GENERATION_FAILED를 처리합니다.
자동 배치 대상과 상태 전이
src/main/kotlin/com/nexters/gamss/conversation/*, src/test/kotlin/com/nexters/gamss/conversation/*, deploy/monitor/grafana/dashboards/llm-domain.json
요약이 없거나 SKIPPED인 대화방도 자동 생성 대상에 포함합니다. SKIPPED는 기존 데이터 역직렬화를 위해 유지합니다. Grafana 설명은 FAILED만 비정상 결과로 표시합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DailyAutoCardScheduler
  participant CardService
  participant CardMessageWindow
  participant PromptProvider
  participant CardPersistenceService

  DailyAutoCardScheduler->>CardService: nullable summary 전달
  CardService->>CardMessageWindow: 최근 사용자 메시지 선택
  CardMessageWindow-->>PromptProvider: 최대 4000자 메시지 구간
  PromptProvider-->>CardService: 감정 분류 및 카드 문장
  CardService->>CardPersistenceService: 카드와 nullable summary 저장
  CardPersistenceService-->>CardService: 상태 DONE 처리
Loading

Suggested reviewers: kite707

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Warning

Your free Security trial is over. An organization admin can activate billing to continue.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants