Skip to content

PR 봇 Discord 편의 기능 (리액션·스레드 정리·고정) + 헬퍼 공유화 - #673

Merged
sevineleven merged 1 commit into
devfrom
infra/663-discord-pr-bot-extras
Jul 5, 2026
Merged

PR 봇 Discord 편의 기능 (리액션·스레드 정리·고정) + 헬퍼 공유화#673
sevineleven merged 1 commit into
devfrom
infra/663-discord-pr-bot-extras

Conversation

@sevineleven

Copy link
Copy Markdown
Collaborator

Situation

  • PR 봇을 Slack 에서 Discord 로 옮기며, 봇 초대 시 리액션·스레드 관리·고정 권한을 미리 확보했다(PR 봇 Discord 이관 (slack-pr-bot.yml) #653). 그 권한이 아직 놀고 있었다.
  • #be-pr 채널에서 PR 이 지금 어떤 상태인지(리뷰 대기·작업 중·머지·드랍)가 한눈에 안 들어와, 매번 메시지를 열어봐야 했다.

Task

Action

상태 리액션 (전이형)

부모 메시지에 현재 상태를 리액션 하나로 표시한다. 유니코드 이모지 대신 PiKi 전용 커스텀 이모지 4개를 새로 만들어 브랜드 톤을 맞췄다. 상태가 바뀌면 이전 리액션을 먼저 지우고 현재 것만 남긴다(누적이 아니라 전이).

PR 이벤트 리액션
opened · ready_for_review :piki_open: 열림
synchronize (새 커밋) :piki_wip: 작업중
closed + 머지됨 :piki_done: 머지완료
closed + 머지 없이 닫힘 :piki_closed: 드랍

스레드·고정 정리

  • 열릴 때: 부모 메시지를 채널 상단에 고정해 리뷰 대기 PR 이 위로 뜬다.
  • 닫힐 때: 고정을 해제하고, 스레드 이름에 결과 프리픽스(✅/🗑️)를 붙인 뒤 archive + 잠금한다. 닫힌 PR 스레드가 목록을 어지럽히지 않는다.

헬퍼 리팩터

mention·reviewer·issue·summary 헬퍼 4개가 post_parent·update·reply 세 스텝에 복붙돼 있었다. 한 곳에서 정의하고 각 스텝이 불러 쓰게 바꿨다.

방식 특징 채택
composite action 재사용 범위는 넓지만 별도 checkout 필요 아니오
RUNNER_TEMP 공유 스크립트 같은 job 러너 파일시스템으로 공유, checkout 불필요
  • Prepare 스텝이 헬퍼를 $RUNNER_TEMP/discord-pr-lib.sh 에 한 번 쓰고, 함수가 참조하는 REPO·DISCORD_USER_MAP 은 GITHUB_ENV 로 이후 스텝에 넘긴다.
  • post_parent·update·reply 는 헬퍼 정의를 지우고 source 한 줄로 대체했다.

Result

  • #be-pr 채널에서 PR 상태를 리액션·고정·스레드 이름만 보고 즉시 판별할 수 있다.
  • 리액션은 커스텀 이모지라 봇이 서버에 남아 있어야 동작한다(권한은 PR 봇 Discord 이관 (slack-pr-bot.yml) #653 에서 확보).
  • 채널 고정은 50개 한도가 있어, 닫힐 때 해제로 자연히 회수된다.
  • 투표/아젠다는 봇 권한엔 있으나 지금 필요가 없어 후속으로 남긴다.

연관 이슈

- 상태 전이형 리액션(piki_open/wip/done/closed) 관리 스텝 추가 — 이전 상태 제거 후 현재 상태만 표시
- opened·ready_for_review 시 부모 메시지 채널 고정
- close 시 고정 해제 + 스레드 이름 갱신·아카이브·잠금
- post_parent·update·reply 에 복붙돼 있던 헬퍼 4개를 RUNNER_TEMP 공유 스크립트로 추출
@sevineleven sevineleven added the infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow) label Jul 5, 2026
@sevineleven sevineleven self-assigned this Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@sevineleven, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d6519a98-0f22-4cd9-8101-24f4b683bd8c

📥 Commits

Reviewing files that changed from the base of the PR and between 9acf4f7 and 40f9959.

📒 Files selected for processing (1)
  • .github/workflows/discord-pr-bot.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch infra/663-discord-pr-bot-extras

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.

@sevineleven
sevineleven merged commit 24380f7 into dev Jul 5, 2026
7 checks passed
@sevineleven
sevineleven deleted the infra/663-discord-pr-bot-extras branch July 5, 2026 06:02
sevineleven added a commit that referenced this pull request Jul 5, 2026
느슨한 contains("discord-pr-bot") 는 discord-pr-bot.yml 파일명을 언급한
리뷰 코멘트까지 잡았다. tail -n 1 이 나중에 달린 리뷰 코멘트를 집으면
JSON 이 없어 message_id 를 못 읽고, 리액션·스레드 정리·고정 스텝이 전부
skip 됐다 (#673 머지 시 머지완료 리액션 누락으로 발견).

select 를 test("discord-pr-bot:\\s*\\{") 로 좁혀 JSON 시작 마커가 있는
metadata 코멘트만 매칭한다. #673 코멘트로 실측: OLD 2건 매칭 → NEW 1건.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra 운영 환경 (IaC·클라우드 리소스·secret·배포 workflow)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR 봇 Discord 편의 기능 (리액션·스레드 정리·고정·투표)

1 participant