Skip to content

PR作成時に自動でレビュワーを設定するGitHub Actionsを追加#8984

Merged
komagata merged 1 commit intomainfrom
feature/auto-assign-reviewer
Jul 24, 2025
Merged

PR作成時に自動でレビュワーを設定するGitHub Actionsを追加#8984
komagata merged 1 commit intomainfrom
feature/auto-assign-reviewer

Conversation

@komagata
Copy link
Copy Markdown
Member

@komagata komagata commented Jul 24, 2025

概要

DraftではないPull Requestが作成されたときに、自動でレビュワーを設定するGitHub Actionsワークフローを追加しました。

実装内容

  • .github/workflows/auto-assign-reviewer.ymlを作成
  • PR作成時(opened)およびDraftからReady for reviewに変更時(ready_for_review)にトリガー
  • komagataとokuramasafumiを3:2の確率で重み付きランダム選択
  • PR作成者自身がレビュワーに選ばれた場合は自動でスキップ

動作条件

  • DraftではないPRのみが対象
  • PR作成者は自動的にレビュワー候補から除外

テスト計画

  • 実際にPRを作成してレビュワーが自動設定されることを確認
  • 確率の偏りがないことを複数回のテストで確認

Summary by CodeRabbit

  • 新機能
    • プルリクエスト作成時に、重み付きランダムで自動的にレビュワーが割り当てられるようになりました。

- DraftではないPRが作成されたときに自動実行
- komagataとokuramasafumiを3:2の確率で選択
- PR作成者自身は除外
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

新しいGitHub Actionsワークフロー「Auto Assign Reviewer」が追加されました。プルリクエストがオープンまたはレビュー準備完了時に発火し、ドラフトでない場合のみ実行されます。重み付きランダム選択アルゴリズムでレビュワーを自動割り当てします。

Changes

ファイルパス 変更概要
.github/workflows/auto-assign-reviewer.yml プルリクエスト時に重み付きランダムでレビュワーを自動割当するワークフロー新規追加

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant GitHub Actions
    participant Reviewer
    participant Author

    PR->>GitHub Actions: PRがopenedまたはready_for_review
    GitHub Actions->>GitHub Actions: レビュワー候補リストから重み付きランダム選択
    GitHub Actions->>Author: 選択レビュワーが作者か確認
    alt 選択レビュワー ≠ 作者
        GitHub Actions->>Reviewer: レビューリクエスト送信
    else 選択レビュワー = 作者
        GitHub Actions->>GitHub Actions: 割当スキップ
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Poem

🐇
新しい風が吹くGitの森、
レビュワー選びは運任せ、
重みを乗せてピョンと跳ね、
ランダム割当、誰が来る?
コードの旅路に幸あれ!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9b787 and ec5640f.

📒 Files selected for processing (1)
  • .github/workflows/auto-assign-reviewer.yml (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/auto-assign-reviewer

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot requested a review from okuramasafumi July 24, 2025 10:16
@komagata komagata removed the request for review from okuramasafumi July 24, 2025 10:17
@komagata komagata merged commit 00ab359 into main Jul 24, 2025
2 of 4 checks passed
@komagata komagata deleted the feature/auto-assign-reviewer branch July 24, 2025 10:17
@github-actions github-actions bot mentioned this pull request Jul 24, 2025
87 tasks
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