Skip to content

feat: PR diff inline 코멘트 알림 핸들러 추가#5

Draft
dohyun-ko wants to merge 2 commits into
mainfrom
dohyun-ko/inline-comment-handler
Draft

feat: PR diff inline 코멘트 알림 핸들러 추가#5
dohyun-ko wants to merge 2 commits into
mainfrom
dohyun-ko/inline-comment-handler

Conversation

@dohyun-ko
Copy link
Copy Markdown
Member

@dohyun-ko dohyun-ko commented May 18, 2026

Summary

Files Changed 탭 inline 코멘트 (`pull_request_review_comment` 이벤트) 알림 핸들러 신규 추가 + 다음 두 가지 노이즈 감소 처리.

동작

  1. review_id 단위 dedup — 한 리뷰에 inline 코멘트 N개 → 알림은 1개만 (sync.Map 기반 in-memory, 1h TTL).
  2. wrapper body 가 있으면 skip — review wrapper 본문이 있으면 inline 알림은 보내지 않고 `PullRequestReviewEventSubmitted` 핸들러에 양보 (`body 없을때만 inline에서 아무거나 하나 뽑아서 보여주는` 의도). 이를 위해 `github.Service.FetchReview` 추가.

결과 매트릭스 (한 리뷰 submit 기준)

wrapper body inline 코멘트 알림 수
있음 없음 1 (wrapper, body 포함)
있음 있음 1 (wrapper, body 포함). inline 은 skip
없음 있음 2 (wrapper title-only + inline 1개)
없음 없음 1 (wrapper title-only)

wrapper body 포함은 별도 PR #4 머지 전제. PR #4 와 독립 mergeable.

Notes

  • mention 대상은 IssueCommentCreated 와 동일 패턴 (PR assignees, 없으면 PR 작성자)
  • bot 발신 코멘트는 무시
  • 본문 100 rune truncate + EscapedString
  • 전제: 봇이 single replica. multi-replica 시 dedup 깨지고 각 replica 가 알림 1개씩 보낼 수 있음

Test plan

  • inline 코멘트 1개 → 알림 1개 (본문 포함)
  • inline 코멘트 N개 한 번에 → 알림 1개 (아무거나)
  • review wrapper body + inline 코멘트 → wrapper 알림만, inline 알림 안 옴
  • reply 코멘트 (`in_reply_to_id != null`) → 새 리뷰 wrapper 자동 생성, 알림 1개

🤖 Generated with Claude Code

Files Changed 탭에서 inline 으로 달리는 코멘트 (pull_request_review_comment
이벤트) 알림 핸들러 신규 추가. 기존 issue_comment 패턴과 동일하게 본문은
100 rune 이내로 truncate + escape 후 두 번째 블록으로 첨부. title 에는
파일 경로와 라인 번호 링크를 포함.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@channeltalk
Copy link
Copy Markdown

channeltalk Bot commented May 18, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1adb55a1-1143-42d4-86cf-e330fff2a5d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dohyun-ko/inline-comment-handler

Comment @coderabbitai help to get the list of available commands and usage tips.

…er has body

리뷰어가 Files Changed 탭에서 inline 코멘트를 N개 달면 알림이 N번 떨어지던
문제 개선. 같은 review_id 의 inline 이벤트는 처음 1개만 처리하고 나머지는
skip 한다 (sync.Map 기반 in-memory dedup, 1h TTL).

추가로, review wrapper 본문이 비어있을 때만 inline 알림을 보낸다. wrapper
본문이 있으면 PullRequestReviewEventSubmitted 핸들러가 처리할 수 있도록
양보. 이를 위해 github.Service.FetchReview 추가.

전제: 봇이 single replica.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant