Skip to content

[Feat] 분석 단계별 진행률 callback 전송 - #48

Merged
dldusgh318 merged 2 commits into
SeCause:developfrom
dldusgh318:feat/45-analysis-progress-callback
Oct 15, 2026
Merged

dldusgh318 merged 2 commits into
SeCause:developfrom
dldusgh318:feat/45-analysis-progress-callback

Conversation

@dldusgh318

@dldusgh318 dldusgh318 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

‼️ 관련 이슈

close #45


🔎 개요

Worker의 분석 단계별 처리율을 Spring에 전달하여 기존 상태 조회 및 FE 폴링에 반영합니다.


📝 작업 내용

  • 기존 내부 토큰 callback client에 progress 전송을 추가했습니다.
  • clone 10%, scanner 50%, 정규화/중복 제거 55%, RAG 65%, LLM 95%로 단계 가중치를 정의했습니다.
  • RAG/LLM은 정규화·중복 제거 이후 finding 수로 계산하며, 0건 및 scanner 부분/전체 실패를 처리합니다.
  • 증가한 정수 진행률만 전송하고 전송 실패는 경고 후 분석을 계속합니다.
  • RAG 진행 callback을 별도 스레드에서 실행하여 동기 HTTP/재시도 대기가 DB 이벤트 루프를 막지 않게 했습니다.
  • timeout·401·5xx, 최종 callback 유지, 동일 DB 이벤트 루프 회귀를 mock으로 검증했습니다.

👀 변경 사항

  • BE #54 코드 계약: POST /api/internal/analyses/{analysisId}/progress, X-Internal-Token, {"progressPercent": 정수}(0–100).
  • 신규 환경변수 SPRING_PROGRESS_CALLBACK_PATH 기본값은 위 경로입니다. 기존 timeout 10초, 최대 재시도 2회 설정을 재사용합니다.
  • Worker는 100을 전송하지 않습니다. BE가 결과 저장 후 성공 시 100으로 설정하며, 실패 시 마지막 진행률을 유지합니다.
  • 처리율은 남은 시간 예측이 아닙니다. 기존 result/failure payload 및 분석 순서를 유지합니다.
  • 이 PR에는 [Feat] 분석 단계별 진행률 callback 전송 #45 구현·테스트 두 커밋만 포함합니다.

📸 스크린샷 (Optional)

image

✅ 체크리스트

  • label, milestone, assignees, reviewers 등을 지정했습니다.
  • 성능 개선/최적화 관련 내용이 있는지 확인했습니다.
  • 변경 사항에 대한 테스트를 했습니다.
  • 테스트 시 사용한 로그를 삭제했습니다.

venv/bin/python -m unittest discover -s tests: 70개 통과.
git diff --check: 통과. 테스트 로그는 저장소 외부 임시 경로에만 저장했습니다.


💬 고민사항 및 리뷰 요구사항 (Optional)

  • BE 배포본에 #54 progress API가 포함되어 있어야 합니다.
  • 운영 API/DB/FE 요청은 수행하지 않았습니다. 배포 후 DB 진행률과 기존 상태 조회 응답, FE 폴링 반영을 확인해야 합니다.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a62aabd2-2e2d-4824-afb4-cc2e251dd047
📥 Commits

Reviewing files that changed from the base of the PR and between 69dfdaa and 8695385.

📒 Files selected for processing: 8
  • .env.example
  • app/core/config.py
  • app/jobs/analysis_job.py
  • app/services/callback/spring_client.py
  • app/services/rag/hybrid_search.py
  • tests/jobs/test_analysis_job.py
  • tests/services/callback/test_spring_client.py
  • tests/services/rag/test_hybrid_search.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@dldusgh318 dldusgh318 self-assigned this Oct 14, 2026
@dldusgh318 dldusgh318 added the ✨ FEAT New feature or request label Oct 14, 2026

@boogiewooki02 boogiewooki02 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다!
코드리뷰 확인 부탁드립니다.

Comment on lines +71 to +76
def send_progress(self, analysis_id: int, progress_percent: int) -> None:
self._post_callback(
_format_callback_path(self.progress_path, analysis_id),
AnalysisProgressCallbackPayload(progress_percent=progress_percent),
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

진행률 전송에도 기존 callback의 타임아웃 10초와 재시도 2회 정책이 적용되어, 만약 서버 응답이 없으면 한 번에 약 33초 동안 다음 분석 단계로 넘어가지 못할 수 있어 보입니다. 진행률을 여러 번 전송하는 만큼 대기 시간도 누적될 수 있는데, 진행률 전송에는 타임아웃을 조금 짧게 설정하거나 재시도 횟수를 줄이는 방향을 검토해보면 어떨까요?

@dldusgh318
dldusgh318 merged commit d520cdf into SeCause:develop Oct 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEAT New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 분석 단계별 진행률 callback 전송

2 participants