Repository navigation
refactor: 삐봇 연동 API의 슬랙 의존성 제거 - #2482
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (28)
💤 Files with no reviewable changes (11)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe delivery workflow now stores task state and report snapshots on report changes. The bot API returns one claim shape and accepts ChangesReport change delivery
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Refactor Sequence Diagram(s)sequenceDiagram
participant Bot
participant DiningReportBotController
participant DiningReportDeliveryService
participant DiningReportChangeRepository
participant DiningReportChange
Bot->>DiningReportBotController: Request claim
DiningReportBotController->>DiningReportDeliveryService: claim()
DiningReportDeliveryService->>DiningReportChangeRepository: findClaimable()
DiningReportChangeRepository-->>DiningReportDeliveryService: Eligible change
DiningReportDeliveryService->>DiningReportChange: Initialize and issue attempt
DiningReportDeliveryService-->>Bot: Delivery ID, attempt token, expiry, and report
Bot->>DiningReportBotController: Submit attempt token and outcome
DiningReportBotController->>DiningReportDeliveryService: recordResult()
DiningReportDeliveryService->>DiningReportChangeRepository: Find change by delivery ID
DiningReportDeliveryService->>DiningReportChange: Accept outcome
DiningReportDeliveryService-->>Bot: Current delivery result
Merge Risk: 🔵 Low · up to This changes the bot API so that the bot, rather than the backend, handles Slack delivery. The code appears mergeable. However, the bot must be updated at the same time, and the old delivery consumer must be stopped before deployment. Otherwise report notifications could be missed or duplicated. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 67 functions across 16 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
🔍 개요
🚀 주요 변경 내용
작업 조회는 작업 ID, 시도 토큰, 기한과 제보 내용만 반환하며 슬랙 전송 대상과 메시지 생성 또는 수정 방법은 삐봇에서 결정하도록 합니다.
작업 결과는 시도 토큰과 성공 또는 실패만 받도록 줄이고, 삐봇의 인증에는 기존 서비스 토큰을 사용합니다.
기존 제보 변경 이력에 작업 상태를 기록해 아직 완료되지 않은 작업을 조회하도록 합니다. 실패하거나 기한이 지난 작업은 같은 작업 ID로 다시 배정하며, 재배정 전의 토큰으로 새 시도를 완료할 수 없도록 합니다.
제보 접수와 승인, 반려, 영양사 선처리와 관리자 조회는 기존 동작을 유지합니다.
전송 관련 HTTP 테스트와 중복된 Swagger 검증을 제거하고, 작업 순서와 재배정, 동시 배정, 구버전 변경 기록을 확인하는 서비스 테스트 5개로 줄입니다.
💬 참고 사항
작업 조회와 결과 통보의 본문이 변경되므로 삐봇을 함께 수정해야 합니다. 기존 작업 소비를 중지한 뒤 새 계약을 사용하는 백엔드와 삐봇으로 전환해야 합니다.
dining.report.bot-token만 등록하며, 슬랙 설정과 메시지 중복 반영 방지는 삐봇에서 관리합니다.이미 적용된 V12와 V13은 변경하지 않습니다. V14는 기존 변경 이력에 작업 정보를 추가하며, 기존 슬랙 전송 테이블은 적용 이력과 데이터를 보존하기 위해 남기되 실행 코드에서는 사용하지 않습니다.
변경되는 삐봇 API
/internal/dining/soldout-reports/deliveries/claim/internal/dining/soldout-reports/deliveries/{deliveryId}/result✅ Checklist (완료 조건)
검증 결과
Summary by CodeRabbit
New Features
Improvements