[Feat] Discord Webhook 발송 트리거 추가 및 구조 개선 (#72)#73
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
워크스루여러 서비스 및 그래프 노드에 걸쳐 웹훅 기반 파이프라인 이벤트 알림 시스템을 구현했습니다. 새로운 변경 사항
시퀀스 다이어그램sequenceDiagram
actor Service/Node as 서비스/노드
participant notify as notify_pipeline_event()
participant scheduler as schedule_webhook()
participant discord as Discord 웹훅 API
Service/Node->>notify: event_type, severity, stage, status 등
notify->>notify: 임베드 페이로드 구성
notify->>scheduler: 웹훅 코루틴 전달
scheduler->>discord: await 또는 create_task()로 임베드 전송
discord-->>scheduler: 성공/실패 응답
예상 코드 리뷰 노력🎯 3 (Moderate) | ⏱️ ~25 분 관련 가능성이 있는 이슈
관련 가능성이 있는 PR
제안된 라벨
제안된 리뷰어
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/core/llm_router.py`:
- Around line 13-17: 현재 import 블록에서 동일 모듈을 여러 줄로 나눠 임포트하고 있으니
app.core.job_log_context의 append_job_log와 get_current_job_id를 단일 import로 병합하고,
다른 임포트들과 일관되게 정렬하세요; 즉 변경 대상은 append_job_log, get_current_job_id, get_logger,
get_timeout_policy, notify_pipeline_event, schedule_webhook를 포함하는 import 블록이며 동일
모듈의 중복 import를 하나로 합치고 (원하면 알파벳순으로 정렬) 불필요한 공백을 제거하세요.
In `@app/graph/chat/nodes/analyze_intent.py`:
- Around line 583-594: The code only emits chat_intent_routed for the
GENERAL_CHAT branch, so add the same _emit_intent_event call for the
non-GENERAL_CHAT routing path (e.g., the MODIFY_REQUEST/other intent_type
branch) before returning; ensure you call
_emit_intent_event("chat_intent_routed","info", route.intent_type, a suitable
message like "수정 요청으로 분류되었습니다." or the existing message, and include the same
metadata array with {"name":"Action","value":route.requested_action or
"N/A","inline":True} and {"name":"Scope","value":route.target_scope or
"N/A","inline":True}, then return the updated state with "intent_type":
route.intent_type so the routing event is always emitted (refer to
_emit_intent_event and where intent_type is set).
In `@tests/test_llm_router_webhooks.py`:
- Around line 24-25: The one-line list comprehension in _event_names is too long
and triggers E501; break it into multiple lines to satisfy line-length limits by
either converting the comprehension into an explicit for-loop that builds and
returns a list or by reformatting the list comprehension across lines with
surrounding parentheses (keep the function name _event_names and the inner
next(...) expression intact), ensuring the return annotation list[str] remains
and tests still receive the same list of event_type values.
In `@tests/test_pipeline_webhooks.py`:
- Around line 117-121: The long inline lambda passed to monkeypatch.setattr for
analyze_intent._classify_intent_route is exceeding the line-length lint (Ruff
E501); replace the single long lambda with a short named helper function (e.g.,
def _fake_classify_intent(*args, **kwargs): return
SimpleNamespace(intent_type="MODIFICATION", requested_action="ADD",
target_scope="ITEM")) or format the lambda across multiple lines so the line
length is under the limit, and update the monkeypatch.setattr calls that
reference analyze_intent._classify_intent_route (including the other similar
occurrences) to use the helper function or properly wrapped/line-broken lambda.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a9f92be7-ba0d-4656-91b2-7bb42bc88af0
📒 Files selected for processing (14)
app/core/job_log_context.pyapp/core/llm_router.pyapp/graph/chat/nodes/analyze_intent.pyapp/graph/chat/nodes/mutate.pyapp/graph/chat/nodes/respond.pyapp/graph/roadmap/nodes/finalize.pyapp/graph/roadmap/nodes/places.pyapp/graph/roadmap/nodes/skeleton.pyapp/services/chat_service.pyapp/services/generate_service.pyapp/services/webhook_notification.pytests/test_llm_router_webhooks.pytests/test_pipeline_webhooks.pytests/test_webhook_notification.py
1. 개요
2. 작업 내용
app/services/webhook_notification.py에 공통 pipeline event 포맷을 추가하고, 서버/HTTP/작업 완료/콜백 실패 이벤트를 일관된 필드로 정리했습니다.app/core/llm_router.py에 LLM 호출 성공, 실패, 재시도, fallback 성공/실패 웹훅을 추가해 모델 라우팅 흐름을 추적할 수 있게 했습니다.3. AI 활용 및 검증
AI가 생성한 코드 포함
100% 직접 작성
검증 방법:
git diff --check통과 확인uv/pytest실행기가 없어uv run pytest는 실행하지 못함4. 스크린샷 (선택)
5. 체크리스트
uv run pre-commit run --all-files를 실행하여 통과했는가?Summary by CodeRabbit
릴리스 노트
새 기능
테스트