Skip to content

fix: 삭제된 게시판의 게시글을 AI 요약 큐 대상에서 제외#2312

Merged
taejinn merged 1 commit into
developfrom
fix/article-ai-summary-deleted-board
Jul 24, 2026
Merged

fix: 삭제된 게시판의 게시글을 AI 요약 큐 대상에서 제외#2312
taejinn merged 1 commit into
developfrom
fix/article-ai-summary-deleted-board

Conversation

@dh2906

@dh2906 dh2906 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔍 개요

  • 게시글 AI 요약 스케줄러가 매번 실패해 요약이 하나도 만들어지지 않던 문제를 고칩니다.
  • 삭제된 게시판에 남아 있는 게시글이 요약 대상으로 잡히면서 배치 전체가 중단되고 있었습니다.

🚀 주요 변경 내용

  • 요약할 게시글을 고를 때 삭제된 게시판의 게시글은 제외하도록 조회 조건을 추가했습니다.
  • 삭제된 게시판은 서비스에서 이미 보이지 않는 게시판이므로, 그 안의 글은 요약을 만들 필요가 없습니다.
  • 기존에는 요약 대상이 항상 같은 순서로 뽑혀, 문제가 되는 게시글 하나 때문에 정상 게시글까지 계속 요약이 밀려 있었습니다. 이번 수정으로 다음 실행부터 정상 게시글이 다시 요약 대기열에 올라갑니다.
  • 같은 상황이 다시 생기지 않도록 재현 테스트를 추가했습니다.

💬 참고 사항

  • 발생 로그: JpaObjectRetrievalFailureException: ... Board with identifier value 3 does not exist
  • 별도의 데이터 정리나 마이그레이션은 필요 없습니다. 배포 후 다음 스케줄 실행부터 자동으로 정상화됩니다.
  • 추가한 테스트는 로컬에 Docker(Testcontainers) 환경이 없어 실행 검증은 못 했고 컴파일까지만 확인했습니다. CI 결과를 확인해 주세요.

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • Bug Fixes
    • Deleted boards’ articles are no longer included in the AI summary processing queue.
    • Articles on active boards continue to be processed as expected.

- 삭제된 게시판에 달린 게시글까지 요약 후보로 뽑혀 배치 전체가 실패했다
- Board 엔티티는 삭제된 게시판을 조회에서 감추기 때문에 게시글을 읽는 순간 예외가 났다
- 후보가 매번 같은 순서로 뽑혀 요약 큐 등록이 계속 막혀 있었다
- 후보 조회 쿼리에 게시판 조인을 추가해 삭제된 게시판의 게시글을 제외한다
@dh2906 dh2906 self-assigned this Jul 23, 2026
@github-actions github-actions Bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label Jul 23, 2026
@github-actions
github-actions Bot requested review from kih1015 and taejinn July 23, 2026 23:28
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0bb5ab6a-c902-48e3-8862-de5a49c19a5e

📥 Commits

Reviewing files that changed from the base of the PR and between 6f0818b and 87a3c1f.

📒 Files selected for processing (2)
  • src/main/java/in/koreatech/koin/domain/community/article/repository/ArticleRepository.java
  • src/test/java/in/koreatech/koin/acceptance/domain/ArticleAiSummaryApiTest.java

📝 Walkthrough

Walkthrough

The article summary selection query now excludes articles from deleted boards. Acceptance coverage adds board deletion setup and verifies only articles on active boards receive AI summary records.

Changes

Article AI summary filtering

Layer / File(s) Summary
Deleted-board query filtering
src/main/java/in/koreatech/koin/domain/community/article/repository/ArticleRepository.java
The native query joins boards and filters for non-deleted boards when selecting articles without summaries.
Acceptance coverage for enqueue behavior
src/test/java/in/koreatech/koin/acceptance/domain/ArticleAiSummaryApiTest.java
The test injects the summary service and board repository, creates a deleted-board article, and verifies it is excluded while an active-board article receives a summary record.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: taejinn, soundbar91

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: excluding articles from deleted boards from the AI summary queue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 fix/article-ai-summary-deleted-board

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.

@github-actions

Copy link
Copy Markdown

Unit Test Results

774 tests   771 ✔️  1m 25s ⏱️
186 suites      3 💤
186 files        0

Results for commit 87a3c1f.

@taejinn

taejinn commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

감사합니다 🥹

@taejinn
taejinn merged commit 1629d1f into develop Jul 24, 2026
8 checks passed
@taejinn
taejinn deleted the fix/article-ai-summary-deleted-board branch July 24, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants